Skip to content

Commit

Permalink
avoid hard-coding the default compiler
Browse files Browse the repository at this point in the history
  • Loading branch information
pepeiborra committed Jul 26, 2020
1 parent 2fe1447 commit d286ae8
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions shell.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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 [];
Expand Down

0 comments on commit d286ae8

Please sign in to comment.