diff options
author | Dennis Gosnell <cdep.illabout@gmail.com> | 2021-01-27 22:37:41 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-01-27 22:37:41 +0900 |
commit | 987b80a824261d7bdbb14a46dc8b3814689da56e (patch) | |
tree | 4b29c58b8002401ea209130e14641e75342eced7 /pkgs/development/haskell-modules/make-package-set.nix | |
parent | 9c5389e47a6d7ab8a5110c12e84e57d22fd3af41 (diff) | |
parent | 95d0e6c1b8adca3a03c5e79fc1dba84b5c1f68d6 (diff) | |
download | nixlib-987b80a824261d7bdbb14a46dc8b3814689da56e.tar nixlib-987b80a824261d7bdbb14a46dc8b3814689da56e.tar.gz nixlib-987b80a824261d7bdbb14a46dc8b3814689da56e.tar.bz2 nixlib-987b80a824261d7bdbb14a46dc8b3814689da56e.tar.lz nixlib-987b80a824261d7bdbb14a46dc8b3814689da56e.tar.xz nixlib-987b80a824261d7bdbb14a46dc8b3814689da56e.tar.zst nixlib-987b80a824261d7bdbb14a46dc8b3814689da56e.zip |
Merge pull request #109059 from jkachmar/haskell-generic-builder-args-modifier
Adds Haskell generic builder argument modifier
Diffstat (limited to 'pkgs/development/haskell-modules/make-package-set.nix')
-rw-r--r-- | pkgs/development/haskell-modules/make-package-set.nix | 35 |
1 files changed, 33 insertions, 2 deletions
diff --git a/pkgs/development/haskell-modules/make-package-set.nix b/pkgs/development/haskell-modules/make-package-set.nix index 28b48bfcbc4a..2641892672af 100644 --- a/pkgs/development/haskell-modules/make-package-set.nix +++ b/pkgs/development/haskell-modules/make-package-set.nix @@ -327,6 +327,37 @@ in package-set { inherit pkgs lib callPackage; } self // { # packages. You should set this to true if you have benchmarks defined # in your local packages that you want to be able to run with cabal benchmark doBenchmark ? false + # An optional function that can modify the generic builder arguments + # for the fake package that shellFor uses to construct its environment. + # + # Example: + # let + # # elided... + # haskellPkgs = pkgs.haskell.packages.ghc884.override (hpArgs: { + # overrides = pkgs.lib.composeExtensions (hpArgs.overrides or (_: _: { })) ( + # _hfinal: hprev: { + # mkDerivation = args: hprev.mkDerivation ({ + # doCheck = false; + # doBenchmark = false; + # doHoogle = true; + # doHaddock = true; + # enableLibraryProfiling = false; + # enableExecutableProfiling = false; + # } // args); + # } + # ); + # }); + # in + # hpkgs.shellFor { + # packages = p: [ p.foo ]; + # genericBuilderArgsModifier = args: args // { doCheck = true; doBenchmark = true }; + # } + # + # This will disable tests and benchmarks for everything in "haskellPkgs" + # (which will invalidate the binary cache), and then re-enable them + # for the "shellFor" environment (ensuring that any test/benchmark + # dependencies for "foo" will be available within the nix-shell). + , genericBuilderArgsModifier ? (args: args) , ... } @ args: let @@ -443,7 +474,7 @@ in package-set { inherit pkgs lib callPackage; } self // { # This is a derivation created with `haskellPackages.mkDerivation`. # # pkgWithCombinedDeps :: HaskellDerivation - pkgWithCombinedDeps = self.mkDerivation genericBuilderArgs; + pkgWithCombinedDeps = self.mkDerivation (genericBuilderArgsModifier genericBuilderArgs); # The derivation returned from `envFunc` for `pkgWithCombinedDeps`. # @@ -457,7 +488,7 @@ in package-set { inherit pkgs lib callPackage; } self // { # pkgWithCombinedDepsDevDrv :: Derivation pkgWithCombinedDepsDevDrv = pkgWithCombinedDeps.envFunc { inherit withHoogle; }; - mkDerivationArgs = builtins.removeAttrs args [ "packages" "withHoogle" "doBenchmark" ]; + mkDerivationArgs = builtins.removeAttrs args [ "genericBuilderArgsModifier" "packages" "withHoogle" "doBenchmark" ]; in pkgWithCombinedDepsDevDrv.overrideAttrs (old: mkDerivationArgs // { nativeBuildInputs = old.nativeBuildInputs ++ mkDerivationArgs.nativeBuildInputs or []; |