Skip to content

Commit 5fec0f0

Browse files
committed
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.
1 parent d041a7e commit 5fec0f0

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

overlays/haskell.nix

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -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)