Skip to content

Commit

Permalink
Add compiler-nix-name arg to stackProject
Browse files Browse the repository at this point in the history
  • Loading branch information
hamishmack committed Oct 27, 2020
1 parent 2f48630 commit 79e39b1
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
4 changes: 2 additions & 2 deletions docs/tutorials/getting-started.md
Expand Up @@ -51,8 +51,8 @@ Add `default.nix`:
name = "haskell-nix-project";
src = ./.;
};
# For `cabal.project` based projects specify the GHC version to use.
compiler-nix-name = "ghc884"; # Not used for `stack.yaml` based projects.
# Specify the GHC version to use.
compiler-nix-name = "ghc8102"; # Not required for `stack.yaml` based projects.
}
```

Expand Down
8 changes: 5 additions & 3 deletions overlays/haskell.nix
Expand Up @@ -567,9 +567,11 @@ final: prev: {
in let pkg-set = mkStackPkgSet
{ stack-pkgs = importAndFilterProject callProjectResults;
pkg-def-extras = (args.pkg-def-extras or []);
modules = final.lib.singleton (mkCacheModule cache)
++ (args.modules or [])
++ final.lib.optional (args ? ghc) { ghc.package = args.ghc; };
modules = final.lib.singleton (mkCacheModule cache)
++ (args.modules or [])
++ final.lib.optional (args ? ghc) { ghc.package = args.ghc; }
++ final.lib.optional (args ? compiler-nix-name)
{ compiler.nix-name = final.lib.mkForce args.compiler-nix-name; };
};

project = addProjectAndPackageAttrs {
Expand Down

0 comments on commit 79e39b1

Please sign in to comment.