Fix tool functions (#1570)

This commit is contained in:
Hamish Mackenzie 2022-08-01 23:57:29 +12:00 committed by GitHub
parent 33ac5a137d
commit ce047883ac
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 13 additions and 9 deletions

View File

@ -152,7 +152,7 @@ in
nativeBuildInputs = [ ghcEnv ]
++ nativeBuildInputs
++ mkDrvArgs.nativeBuildInputs or []
++ lib.attrValues (buildPackages.haskell-nix.tools evalPackages compiler.nix-name tools)
++ lib.attrValues (buildPackages.haskell-nix.tools' evalPackages compiler.nix-name tools)
# If this shell is a cross compilation shell include
# wrapper script for running cabal build with appropriate args.
# Includes `--with-compiler` in case the `cabal.project` file has `with-compiler:` in it.

View File

@ -496,8 +496,8 @@ final: prev: {
inherit pkg-set;
plan-nix = callProjectResults.projectNix;
inherit (callProjectResults) index-state;
tool = final.buildPackages.haskell-nix.tool pkg-set.config.compiler.nix-name;
tools = final.buildPackages.haskell-nix.tools pkg-set.config.compiler.nix-name;
tool = final.buildPackages.haskell-nix.tool' evalPackages pkg-set.config.compiler.nix-name;
tools = final.buildPackages.haskell-nix.tools' evalPackages pkg-set.config.compiler.nix-name;
roots = final.haskell-nix.roots pkg-set.config.compiler.nix-name;
projectFunction = haskell-nix: haskell-nix.cabalProject';
inherit projectModule buildProject args;
@ -788,8 +788,8 @@ final: prev: {
inherit (pkg-set.config) hsPkgs;
inherit pkg-set;
stack-nix = callProjectResults.projectNix;
tool = final.buildPackages.haskell-nix.tool pkg-set.config.compiler.nix-name;
tools = final.buildPackages.haskell-nix.tools pkg-set.config.compiler.nix-name;
tool = final.buildPackages.haskell-nix.tool' evalPackages pkg-set.config.compiler.nix-name;
tools = final.buildPackages.haskell-nix.tools' evalPackages pkg-set.config.compiler.nix-name;
roots = final.haskell-nix.roots pkg-set.config.compiler.nix-name;
projectFunction = haskell-nix: haskell-nix.stackProject';
inherit projectModule buildProject args;

View File

@ -77,12 +77,16 @@ in { haskell-nix = prev.haskell-nix // {
tool = compiler-nix-name: name: versionOrMod:
final.haskell-nix.hackage-tool (
final.haskell-nix.haskellLib.versionOrModToMods versionOrMod
++ [{ inherit compiler-nix-name name; }]
++ [(lib.mapAttrs (_: lib.mkOverride 1100) { inherit compiler-nix-name name; })]
);
tools = evalPackages: compiler-nix-name:
lib.mapAttrs (name: versionOrMod:
# tool with a default evalPackages to use.
tool' = evalPackages: compiler-nix-name: name: versionOrMod:
final.haskell-nix.hackage-tool (
final.haskell-nix.haskellLib.versionOrModToMods versionOrMod
++ [{ inherit evalPackages compiler-nix-name name; }]));
++ [(lib.mapAttrs (_: lib.mkOverride 1100) { inherit evalPackages compiler-nix-name name; })]
);
tools = compiler-nix-name: lib.mapAttrs (final.haskell-nix.tool compiler-nix-name);
tools' = evalPackages: compiler-nix-name: lib.mapAttrs (final.haskell-nix.tool' evalPackages compiler-nix-name);
}; }