From 233087eb79260b55720b2a50b6d1d7e3b0c14bab Mon Sep 17 00:00:00 2001 From: Potato Hatsue <1793913507@qq.com> Date: Wed, 9 Jun 2021 21:15:39 +0800 Subject: [PATCH] haskellPackages.nvfetcher: move overrideCabal to configuration-nix.nix --- .../haskell-modules/configuration-nix.nix | 12 ++++++++++++ pkgs/top-level/all-packages.nix | 8 +------- 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/pkgs/development/haskell-modules/configuration-nix.nix b/pkgs/development/haskell-modules/configuration-nix.nix index 538d5381a96a..238f7c38bc13 100644 --- a/pkgs/development/haskell-modules/configuration-nix.nix +++ b/pkgs/development/haskell-modules/configuration-nix.nix @@ -833,4 +833,16 @@ self: super: builtins.intersectAttrs super { sed -i 's|"tophat"|"./dist/build/tophat/tophat"|' app-test-bin/*.hs '' + (drv.postPatch or ""); }); + + # Runtime dependencies and CLI completion + nvfetcher = generateOptparseApplicativeCompletion "nvfetcher" (overrideCabal + super.nvfetcher (drv: { + buildTools = drv.buildTools or [ ] ++ [ pkgs.makeWrapper ]; + postInstall = drv.postInstall or "" + '' + wrapProgram "$out/bin/nvfetcher" --prefix 'PATH' ':' "${ + pkgs.lib.makeBinPath [ pkgs.nvchecker pkgs.nix-prefetch-git ] + }" + ''; + })); + } diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index c537b0545a37..2b33d4b98f5d 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -7202,13 +7202,7 @@ in nvchecker = with python3Packages; toPythonApplication nvchecker; - nvfetcher = with haskell.lib; overrideCabal (justStaticExecutables haskellPackages.nvfetcher) (drv: { - executableToolDepends = [ makeWrapper ]; - postInstall = '' - wrapProgram $out/bin/nvfetcher \ - --prefix PATH ":" "${nvchecker}/bin:${nix-prefetch-git}/bin" - ''; - }); + nvfetcher = haskell.lib.justStaticExecutables haskellPackages.nvfetcher; miller = callPackage ../tools/text/miller { };