on iko/ghcjs-patch-master help sign in
Add `compiler-nix-name` arg to stackProject (#897)
5f80ca9Hamish Mackenzie
@@ -1,6 +1,10 @@
1This file contains a summary of changes to Haskell.nix and `nix-tools`
1This file contains a summary of changes to Haskell.nix and `nix-tools`
2that will impact users.
2that will impact users.
3
3
4+## Oct 28, 2020
5+* Passing `compiler-nix-name` to project functions for `stack.yaml`
6+ based projects now overrides the compiler used (was ignored before).
7+
4## Sep 8, 2020
8## Sep 8, 2020
5* Added the ability to generate coverage reports for packages and
9* Added the ability to generate coverage reports for packages and
6 projects.
10 projects.
docs/tutorials/getting-started.md+2−2
@@ -51,8 +51,8 @@ Add `default.nix`:
51 name = "haskell-nix-project";
51 name = "haskell-nix-project";
52 src = ./.;
52 src = ./.;
53 };
53 };
54− # For `cabal.project` based projects specify the GHC version to use.
54+ # Specify the GHC version to use.
55− compiler-nix-name = "ghc884"; # Not used for `stack.yaml` based projects.
55+ compiler-nix-name = "ghc8102"; # Not required for `stack.yaml` based projects.
56}
56}
57```
57```
58
58
overlays/haskell.nix+5−3
@@ -567,9 +567,11 @@ final: prev: {
567 in let pkg-set = mkStackPkgSet
567 in let pkg-set = mkStackPkgSet
568 { stack-pkgs = importAndFilterProject callProjectResults;
568 { stack-pkgs = importAndFilterProject callProjectResults;
569 pkg-def-extras = (args.pkg-def-extras or []);
569 pkg-def-extras = (args.pkg-def-extras or []);
570− modules = final.lib.singleton (mkCacheModule cache)
570+ modules = final.lib.singleton (mkCacheModule cache)
571− ++ (args.modules or [])
571+ ++ (args.modules or [])
572− ++ final.lib.optional (args ? ghc) { ghc.package = args.ghc; };
572+ ++ final.lib.optional (args ? ghc) { ghc.package = args.ghc; }
573+ ++ final.lib.optional (args ? compiler-nix-name)
574+ { compiler.nix-name = final.lib.mkForce args.compiler-nix-name; };
573 };
575 };
574
576
575 project = addProjectAndPackageAttrs {
577 project = addProjectAndPackageAttrs {