Make getHaskellBuildInputs / shellFor work with overrideCabal
This commit is contained in:
parent
50bbc56b0b
commit
5523ec8f3c
|
@ -297,8 +297,11 @@ rec {
|
||||||
# This is useful to build environments for developing on that
|
# This is useful to build environments for developing on that
|
||||||
# package.
|
# package.
|
||||||
getHaskellBuildInputs = p:
|
getHaskellBuildInputs = p:
|
||||||
(p.override { mkDerivation = extractBuildInputs p.compiler;
|
(overrideCabal p (args: {
|
||||||
}).haskellBuildInputs;
|
passthru = (args.passthru or {}) // {
|
||||||
|
_getHaskellBuildInputs = extractBuildInputs p.compiler args;
|
||||||
|
};
|
||||||
|
}))._getHaskellBuildInputs;
|
||||||
|
|
||||||
# Under normal evaluation, simply return the original package. Under
|
# Under normal evaluation, simply return the original package. Under
|
||||||
# nix-shell evaluation, return a nix-shell optimized environment.
|
# nix-shell evaluation, return a nix-shell optimized environment.
|
||||||
|
|
|
@ -38,7 +38,7 @@ let
|
||||||
inherit (stdenv) buildPlatform hostPlatform;
|
inherit (stdenv) buildPlatform hostPlatform;
|
||||||
|
|
||||||
inherit (stdenv.lib) fix' extends makeOverridable;
|
inherit (stdenv.lib) fix' extends makeOverridable;
|
||||||
inherit (haskellLib) overrideCabal;
|
inherit (haskellLib) overrideCabal getHaskellBuildInputs;
|
||||||
|
|
||||||
mkDerivationImpl = pkgs.callPackage ./generic-builder.nix {
|
mkDerivationImpl = pkgs.callPackage ./generic-builder.nix {
|
||||||
inherit stdenv;
|
inherit stdenv;
|
||||||
|
@ -229,7 +229,7 @@ in package-set { inherit pkgs stdenv callPackage; } self // {
|
||||||
shellFor = { packages, withHoogle ? false, ... } @ args:
|
shellFor = { packages, withHoogle ? false, ... } @ args:
|
||||||
let
|
let
|
||||||
selected = packages self;
|
selected = packages self;
|
||||||
packageInputs = builtins.map (p: p.override { mkDerivation = haskellLib.extractBuildInputs p.compiler; }) selected;
|
packageInputs = builtins.map getHaskellBuildInputs selected;
|
||||||
haskellInputs =
|
haskellInputs =
|
||||||
builtins.filter
|
builtins.filter
|
||||||
(input: pkgs.lib.all (p: input.outPath != p.outPath) selected)
|
(input: pkgs.lib.all (p: input.outPath != p.outPath) selected)
|
||||||
|
|
Loading…
Reference in a new issue