From 5a34373cca022ab37ec05da678a5debb655228a2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A9ana=20=E6=B1=9F?= Date: Tue, 20 May 2025 17:32:13 +0200 Subject: [PATCH] prop-solveur: migrate to by-name --- nix/packages/by-name/prop-solveur/package.nix | 33 +++++++++++++++++++ nix/packages/top-level.nix | 14 -------- 2 files changed, 33 insertions(+), 14 deletions(-) create mode 100644 nix/packages/by-name/prop-solveur/package.nix diff --git a/nix/packages/by-name/prop-solveur/package.nix b/nix/packages/by-name/prop-solveur/package.nix new file mode 100644 index 00000000..c9200357 --- /dev/null +++ b/nix/packages/by-name/prop-solveur/package.nix @@ -0,0 +1,33 @@ +{ + haskellPackages, + haskell, + fetchFromGitea, + installShellFiles, +}: let + inherit (haskell.lib.compose) justStaticExecutables overrideCabal; + + drv = + haskellPackages.callCabal2nix "prop-solveur" + (fetchFromGitea { + domain = "git.confusedcompiler.org"; + owner = "leana8959"; + repo = "prop_solveur"; + rev = "cc2430dc5a396b01d02bd925070ce5d009d05bc4"; + hash = "sha256-jwNfRBytf/w0d2CWczXp+rVRXYNzptkuFE3OKSdOhLc="; + }) + {}; + + cabalOverrides = o: { + buildTools = o.buildTools or [] ++ [installShellFiles]; + postInstall = + o.postInstall or "" + + '' + installShellCompletion --cmd prop-solveur \ + --bash <("$out/bin/prop-solveur" --bash-completion-script "$out/bin/prop-solveur") \ + --fish <("$out/bin/prop-solveur" --fish-completion-script "$out/bin/prop-solveur") \ + --zsh <("$out/bin/prop-solveur" --zsh-completion-script "$out/bin/prop-solveur") + ''; + }; +in + justStaticExecutables + (overrideCabal cabalOverrides drv) diff --git a/nix/packages/top-level.nix b/nix/packages/top-level.nix index 0380fc96..19215c1f 100644 --- a/nix/packages/top-level.nix +++ b/nix/packages/top-level.nix @@ -38,20 +38,6 @@ in rec { ]; }; - prop-solveur = mkHaskellPackage { - name = "prop-solveur"; - src = sources.prop_solveur; - apply = infuse { - __output.nativeBuildInputs.__append = [pkgs.installShellFiles]; - __output.postInstall.__append = '' - installShellCompletion --cmd prop-solveur \ - --bash <("$out/bin/prop-solveur" --bash-completion-script "$out/bin/prop-solveur") \ - --fish <("$out/bin/prop-solveur" --fish-completion-script "$out/bin/prop-solveur") \ - --zsh <("$out/bin/prop-solveur" --zsh-completion-script "$out/bin/prop-solveur") - ''; - }; - }; - audio-lint = pkgs.rustPlatform.buildRustPackage rec { pname = "audio-lint"; version = lib.substring 0 8 sources.audio-lint.rev;