@@ -7,7 +7,9 @@
7, materialized ? null # Location of a materialized copy of the nix files
7, materialized ? null # Location of a materialized copy of the nix files
8, checkMaterialization ? null # If true the nix files will be generated used to check plan-sha256 and material
8, checkMaterialization ? null # If true the nix files will be generated used to check plan-sha256 and material
9, cabalProject ? null # Cabal project file (when null uses "${src}/cabal.project")
9, cabalProject ? null # Cabal project file (when null uses "${src}/cabal.project")
10−, ghc ? defaults.ghc
10+, compiler-nix-name ? null # Nix name of the ghc compiler as a string eg. "ghc883"
11+, ghc ? null # Deprecated in favour of `compiler-nix-name`
12+, ghcOverride ? null # Used when we need to set ghc explicitly during bootstrapping
11, nix-tools ? defaults.nix-tools
13, nix-tools ? defaults.nix-tools
12, hpack ? defaults.hpack
14, hpack ? defaults.hpack
13, cabal-install ? defaults.cabal-install
15, cabal-install ? defaults.cabal-install
@@ -31,11 +33,31 @@ assert (if (builtins.compareVersions cabal-install.version "2.4.0.0") < 0
31 then throw "cabal-install (current version: ${cabal-install.version}) needs to be at least 2.4 for plan-to-nix to work without cabal-to-nix"
33 then throw "cabal-install (current version: ${cabal-install.version}) needs to be at least 2.4 for plan-to-nix to work without cabal-to-nix"
32 else true);
34 else true);
37+ forName = pkgs.lib.optionalString (name != null) (" for " + name);
40+ if ghcOverride != null
44+ then __trace ("WARNING: A `ghc` argument was passed" + forName
45+ + " this has been deprecated in favour of `compiler-nix-name`. "
46+ + "Using `ghc` will break cross compilation setups, as haskell.nix can not"
47+ + "pick the correct `ghc` package from the respective buildPackages. "
48+ + "For example use `compiler-nix-name = \"ghc865\";` for ghc 8.6.5") ghc
50+ if compiler-nix-name != null
51+ then pkgs.buildPackages.haskell-nix.compiler."${compiler-nix-name}"
34−assert (if ghc.isHaskellNixCompiler or false then true
55+ assert (if ghc'.isHaskellNixCompiler or false then true
35− else throw ("It is likely you used `haskell.compiler.X` instead of `haskell-nix.compiler.X`"
56+ else throw ("It is likely you used `haskell.compiler.X` instead of `haskell-nix.compiler.X`"
36− + pkgs.lib.optionalString (name != null) (" for " + name)));
57+ + forName));
39 maybeCleanedSource =
61 maybeCleanedSource =
40 if haskellLib.canCleanSource src
62 if haskellLib.canCleanSource src
41 then haskellLib.cleanSourceWith {
63 then haskellLib.cleanSourceWith {