Skip to content

Commit 75cae0a

Browse files
authored
Fix building stack projects with hix (input-output-hk#1998)
The default compiler-nix-name provided for hix projects conflicts with the one implied by the `stack.yaml` `resolver`. Fixes input-output-hk#1997
1 parent dbca7d8 commit 75cae0a

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

modules/hix-project.nix

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
{ lib, ... }: {
1+
{ config, lib, ... }: {
22
_file = "haskell.nix/modules/hix-project.nix";
33
options = {
44
# These are options that only the Hix command wrappers use. If you make a flake
@@ -40,8 +40,10 @@
4040
};
4141
};
4242

43-
# Default values for other project options (things that do not have defaults for non hix projects)
44-
config = {
45-
compiler-nix-name = lib.mkDefault "ghc8107";
43+
# Default value for compiler-nix-name (does not have a default for non hix projects).
44+
# Stack projects do not require a default as the `resolver` in the `stack.yaml`
45+
# specifies one.
46+
config = lib.mkIf (!config ? "stackYaml") {
47+
compiler-nix-name = lib.mkDefault "ghc945";
4648
};
4749
}

0 commit comments

Comments
 (0)