Skip to content

Commit 8bed466

Browse files
authored
Respect defaults in shellFor (fixes #2306) (#2322)
* Respect defaults in `shellFor` (fixes #2306) `shellFor` has an argument `allToolDeps` that when set to `true` tells haskell.nix to include all the tool dependencies of all the packages in the shell. This does not work well for `stackProject` projects (since stackage includes a lot of packages). So it is disabled by default in `modules/stack-project.nix`. This default is currently ignored if `shellFor` is called directly. This change ensures that `shellFor` respects the defaults and any shell arguments passed to the project. As a result, `project.shell` and `project.shellFor {}` will now behave consistently. * Fix use of `hackage` in `mkStackPkgSet`
1 parent 2df64d5 commit 8bed466

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

overlays/haskell.nix

+3-3
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ final: prev: {
110110
You may need to update haskell.nix to one that includes a newer stackage.nix.
111111
'');
112112
# The compiler referenced in the stack config
113-
compiler = (stack-pkgs.extras hackage).compiler or (pkg-def hackage).compiler;
113+
compiler = (stack-pkgs.extras hackageForStack).compiler or (pkg-def hackageForStack).compiler;
114114
patchesModule = ghcHackagePatches.${compiler.nix-name} or {};
115115
# Remove fake packages generated from stack keywords used in ghc-options
116116
removeStackSpecial = module: if builtins.typeOf module == "set"
@@ -823,7 +823,7 @@ final: prev: {
823823
shellFor = shellArgs:
824824
let
825825
# These are the args we will pass to the main shell.
826-
args' = builtins.removeAttrs shellArgs [ "crossPlatforms" ];
826+
args' = builtins.removeAttrs (rawProject.args.shell // shellArgs) [ "crossPlatforms" ];
827827
# These are the args we will pass to the shells for the corss compiler
828828
argsCross =
829829
# These things should match main shell
@@ -847,7 +847,7 @@ final: prev: {
847847
});
848848

849849
# Default shell
850-
shell = shellFor rawProject.args.shell;
850+
shell = shellFor {};
851851

852852
# Like `.hsPkgs.${packageName}` but when compined with `getComponent` any
853853
# cabal configure errors are defered until the components derivation builds.

0 commit comments

Comments
 (0)