avoid hard-coding the default compiler

This commit is contained in:
Pepe Iborra 2020-07-26 15:35:50 +01:00
parent 2fe1447710
commit d286ae810d

View File

@ -10,8 +10,9 @@
}:
with nixpkgs;
let haskellPackagesForProject = p:
if compiler == "default" || compiler == "ghc883"
let defaultCompiler = "ghc" + lib.replaceStrings ["."] [""] haskellPackages.ghc.version;
haskellPackagesForProject = p:
if compiler == "default" || compiler == defaultCompiler
then haskellPackages.ghcWithPackages p
# for all other compilers there is no Nix cache so dont bother building deps with NIx
else haskell.packages.${compiler}.ghcWithPackages [];