about summary refs log tree commit diff
path: root/pkgs/development/haskell-modules
diff options
context:
space:
mode:
authorPeter Simons <simons@cryp.to>2018-05-22 10:37:26 +0200
committerGitHub <noreply@github.com>2018-05-22 10:37:26 +0200
commit07a045922d5c514d9a074cc6ffbfff934ea2d6f8 (patch)
tree7d5279da005dccf7250b69a26f0317ff57a210cf /pkgs/development/haskell-modules
parent5093abc8f12723f633bbb696c22b2f06d2e27614 (diff)
parent5523ec8f3c78704c6e76b7675bfce41d24a3feb1 (diff)
downloadnixlib-07a045922d5c514d9a074cc6ffbfff934ea2d6f8.tar
nixlib-07a045922d5c514d9a074cc6ffbfff934ea2d6f8.tar.gz
nixlib-07a045922d5c514d9a074cc6ffbfff934ea2d6f8.tar.bz2
nixlib-07a045922d5c514d9a074cc6ffbfff934ea2d6f8.tar.lz
nixlib-07a045922d5c514d9a074cc6ffbfff934ea2d6f8.tar.xz
nixlib-07a045922d5c514d9a074cc6ffbfff934ea2d6f8.tar.zst
nixlib-07a045922d5c514d9a074cc6ffbfff934ea2d6f8.zip
Merge pull request #40710 from ElvishJerricco/overrideCabal-getHaskellBuildInputs
Make getHaskellBuildInputs / shellFor work with overrideCabal (Fixes #40266)
Diffstat (limited to 'pkgs/development/haskell-modules')
-rw-r--r--pkgs/development/haskell-modules/lib.nix7
-rw-r--r--pkgs/development/haskell-modules/make-package-set.nix4
2 files changed, 7 insertions, 4 deletions
diff --git a/pkgs/development/haskell-modules/lib.nix b/pkgs/development/haskell-modules/lib.nix
index ff86e06979c1..55e45bd6559d 100644
--- a/pkgs/development/haskell-modules/lib.nix
+++ b/pkgs/development/haskell-modules/lib.nix
@@ -297,8 +297,11 @@ rec {
   # This is useful to build environments for developing on that
   # package.
   getHaskellBuildInputs = p:
-    (p.override { mkDerivation = extractBuildInputs p.compiler;
-                }).haskellBuildInputs;
+    (overrideCabal p (args: {
+      passthru = (args.passthru or {}) // {
+        _getHaskellBuildInputs = extractBuildInputs p.compiler args;
+      };
+    }))._getHaskellBuildInputs;
 
   # Under normal evaluation, simply return the original package. Under
   # nix-shell evaluation, return a nix-shell optimized environment.
diff --git a/pkgs/development/haskell-modules/make-package-set.nix b/pkgs/development/haskell-modules/make-package-set.nix
index bbc3d856ff2d..d20a86b0064e 100644
--- a/pkgs/development/haskell-modules/make-package-set.nix
+++ b/pkgs/development/haskell-modules/make-package-set.nix
@@ -38,7 +38,7 @@ let
   inherit (stdenv) buildPlatform hostPlatform;
 
   inherit (stdenv.lib) fix' extends makeOverridable;
-  inherit (haskellLib) overrideCabal;
+  inherit (haskellLib) overrideCabal getHaskellBuildInputs;
 
   mkDerivationImpl = pkgs.callPackage ./generic-builder.nix {
     inherit stdenv;
@@ -238,7 +238,7 @@ in package-set { inherit pkgs stdenv callPackage; } self // {
     shellFor = { packages, withHoogle ? false, ... } @ args:
       let
         selected = packages self;
-        packageInputs = builtins.map (p: p.override { mkDerivation = haskellLib.extractBuildInputs p.compiler; }) selected;
+        packageInputs = builtins.map getHaskellBuildInputs selected;
         haskellInputs =
           builtins.filter
             (input: pkgs.lib.all (p: input.outPath != p.outPath) selected)