haskell-nix
haskell-nix copied to clipboard
Changing the compiler doesn't work well with callCabal2nix
When using the suggested format
haskell = pkgs.haskell // {
packages = pkgs.haskell.packages // {
"${compiler}" = pkgs.haskell.packages."${compiler}".override {
overrides = galoisOverrides;
};
};
};
to override the GHC version, the pkgs.haskellPackages
attribute is not overriden, so e.g. callCabal2nix
doesn't use the selected version. Additionally, one must select the package from the new compiler's package set:
project1 = pkgs.haskell.packages.${compiler}.project1;
Why not use the following instead?
haskellPackages = pkgs.haskell.packages."${compiler}".override {
overrides = [...];
};
This provides a more consistent interface for the rest of your Nix files.
@siddharthist: How are you invoking callCabal2nix
? The reason I ask is that pkgs.haskell.packages.${compiler}.callCabal2nix
should work or haskellPackagesNew.callCabal2nix
should work inside an override block
However, I still agree that it would probably be simpler to override haskellPackages
so I'll still make that change
@Gabriel439 I was using it in such a way that I was getting haskellPackages.callCabal2nix
instead of haskell.packages.${compiler}
, which makes more sense... Thanks!