From 84b70a6fb0ad883554c4e452edac0c37a854b2e1 Mon Sep 17 00:00:00 2001 From: Hamish Mackenzie Date: Thu, 13 Jul 2023 16:41:19 +1200 Subject: [PATCH] Fix building stack projects with hix The default compiler-nix-name provided for hix projects conflicts with the one implied by the `stack.yaml` `resolver`. Fixes #1997 --- modules/hix-project.nix | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/modules/hix-project.nix b/modules/hix-project.nix index 3b40f65971..62db5e9bbd 100644 --- a/modules/hix-project.nix +++ b/modules/hix-project.nix @@ -1,4 +1,4 @@ -{ lib, ... }: { +{ config, lib, ... }: { _file = "haskell.nix/modules/hix-project.nix"; options = { # These are options that only the Hix command wrappers use. If you make a flake @@ -40,8 +40,10 @@ }; }; - # Default values for other project options (things that do not have defaults for non hix projects) - config = { - compiler-nix-name = lib.mkDefault "ghc8107"; + # Default value for compiler-nix-name (does not have a default for non hix projects). + # Stack projects do not require a default as the `resolver` in the `stack.yaml` + # specifies one. + config = lib.mkIf (!config ? "stackYaml") { + compiler-nix-name = lib.mkDefault "ghc945"; }; }