简体   繁体   中英

Forcing Haskell Stack to be Version 1.7.* on NixOS

Context.

  1. I'm running NixOS, with stack included in my configuration.nix .
  2. Running stack --version yields Version 1.6.3 x86_64 .
  3. But I need Version >=1.7 in order to compile a bleeding edge Haskell package that my team is working on.
  4. The current version on nixpkgs search is 1.6.5 , which is too old anyway.
  5. I think normally on non-NixOS you could just run "stack upgrade" in your home folder, but that doesn't seem to work.

Question: Does anyone know how to force stack on NixOS to compile to version, ie, 1.7.1 ?

Adding this overlay should do the trick:

(self: super: {
  haskellPackages = super.haskellPackages.extend
    (hself: hsuper: {
      stack = (hsuper.callHackage "stack" "1.7.1" {})
              .overrideScope (hself2: hsuper2: {
        Cabal = hself2.Cabal_2_2_0_1;
        hpack = hself2.hpack_0_28_2;
      });
    });
})

This successfully builds stack on Nixpkgs master. It will be available as the stack attribute or haskellPackages.stack attribute.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM