Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changing the compiler doesn't work well with callCabal2nix #61

Open
langston-barrett opened this issue Aug 14, 2018 · 2 comments
Open

Comments

@langston-barrett
Copy link

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.

@Gabriella439
Copy link
Owner

@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

@langston-barrett
Copy link
Author

@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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants