summary refs log tree commit diff
path: root/pkgs/development/haskell-modules/configuration-common.nix
diff options
context:
space:
mode:
authorJoe Hermaszewski <git@monoid.al>2020-11-06 14:31:00 +0800
committerPeter Simons <simons@cryp.to>2020-11-13 21:37:56 +0100
commitb95bea03858c050fcd8cd2673a253aed45a0307a (patch)
tree431ac28b0039febe57d55d3e4dc524326626e269 /pkgs/development/haskell-modules/configuration-common.nix
parent738d4fef65684233ab7e603b324d0aaa0151d1db (diff)
downloadnixpkgs-b95bea03858c050fcd8cd2673a253aed45a0307a.tar
nixpkgs-b95bea03858c050fcd8cd2673a253aed45a0307a.tar.gz
nixpkgs-b95bea03858c050fcd8cd2673a253aed45a0307a.tar.bz2
nixpkgs-b95bea03858c050fcd8cd2673a253aed45a0307a.tar.lz
nixpkgs-b95bea03858c050fcd8cd2673a253aed45a0307a.tar.xz
nixpkgs-b95bea03858c050fcd8cd2673a253aed45a0307a.tar.zst
nixpkgs-b95bea03858c050fcd8cd2673a253aed45a0307a.zip
haskellPackages.update-nix-fetchgit: Several fixes
Fix versions of dependencies

Generate shell completions

Wrap executable so that required executables are in PATH

Make sure necessary executables for tests are present during build
Diffstat (limited to 'pkgs/development/haskell-modules/configuration-common.nix')
-rw-r--r--pkgs/development/haskell-modules/configuration-common.nix17
1 files changed, 17 insertions, 0 deletions
diff --git a/pkgs/development/haskell-modules/configuration-common.nix b/pkgs/development/haskell-modules/configuration-common.nix
index 96686d990bf..32a539c6573 100644
--- a/pkgs/development/haskell-modules/configuration-common.nix
+++ b/pkgs/development/haskell-modules/configuration-common.nix
@@ -1450,6 +1450,23 @@ self: super: {
   # binary-instances needs the latest version.
   time-compat = self.time-compat_1_9_4;
 
+  # - Deps are required during the build for testing and also during execution,
+  #   so add them to build input and also wrap the resulting binary so they're in
+  #   PATH.
+  update-nix-fetchgit = let deps = [ pkgs.git pkgs.nix pkgs.nix-prefetch-git ];
+  in generateOptparseApplicativeCompletion "update-nix-fetchgit" (overrideCabal
+    (addTestToolDepends (super.update-nix-fetchgit.overrideScope (self: super: {
+      optparse-generic = self.optparse-generic_1_4_4;
+      optparse-applicative = self.optparse-applicative_0_16_0_0;
+    })) deps) (drv: {
+      buildTools = drv.buildTools or [ ] ++ [ pkgs.makeWrapper ];
+      postInstall = drv.postInstall or "" + ''
+        wrapProgram "$out/bin/update-nix-fetchgit" --prefix 'PATH' ':' "${
+          pkgs.lib.makeBinPath deps
+        }"
+      '';
+    }));
+
   optparse-generic_1_4_4 = super.optparse-generic_1_4_4.override {
     optparse-applicative = self.optparse-applicative_0_16_0_0;
   };