stackage2nix icon indicating copy to clipboard operation
stackage2nix copied to clipboard

Make compiler easier to configure

Open jcpetruzza opened this issue 7 years ago • 0 comments

The output of haskell-packages/default.nix at the moment looks something like this:

{ nixpkgs ? import <nixpkgs> {} }:

with nixpkgs;
let  ...
in callPackage (nixpkgs.path + "/pkgs/development/haskell-modules") {
  ghc = pkgs.haskell.compiler.ghc843;
  buildHaskellPackages = buildPackages.haskell.packages.ghc843;
  ...
}

It would be probably nicer if the compiler were another parameter. e.g.:

{ nixpkgs ? import <nixpkgs> {}, compiler ? "ghc843" }:

with nixpkgs;
let  ...
in callPackage (nixpkgs.path + "/pkgs/development/haskell-modules") {
  ghc = pkgs.haskell.compiler.${compiler};
  buildHaskellPackages = buildPackages.haskell.packages.${compiler};
  ...
}

That way one could more easily reuse the same expression with newer versions of nixpkgs, in particular one where only ghc844 is available.

jcpetruzza avatar Jan 08 '19 11:01 jcpetruzza