haskell.nix icon indicating copy to clipboard operation
haskell.nix copied to clipboard

How do I bump my hackage snapshot while using flakes?

Open qwbarch opened this issue 1 year ago • 3 comments

Following these instructions, I've added/changed the following:

  inputs.hackageSrc = {
    url = "github:input-output-hk/hackage.nix";
    flake = false;
  };
  inputs.haskellSrc.url = "github:input-output-hk/haskell.nix";

And within the outputs, I have this defined somewhere:

      haskellNix = import haskellSrc {
        sourcesOverride = hackageSrc;
      };

This is on a default flake, created via nix flake init --template templates#haskell-nix --impure.

This results in the following error when running nix develop:

error: attribute 'currentSystem' missing

       at /nix/store/zhr7hs6bf3jy37nqxykl1wba9nssy40h-source/pkgs/top-level/impure.nix:17:43:

           16|   # (build, in GNU Autotools parlance) platform.
           17|   localSystem ? { system = args.system or builtins.currentSystem; }
             |                                           ^
           18|

I realized builtins.currentSystem doesn't work without --impure, but isn't that against the flakes philoosphy? Also why is it even requiring me to run nix develop --impure in this case?

At the end, this allows nix develop to successfully resolve, but it's still using the snapshot provided by haskell.nix itself.

What is the proper way of bumping my hackage snapshot when using flakes? If needed, I can provide a reproducible example with an older haskell.nix pin to make it easier to see the issue I'm having

qwbarch avatar Jun 25 '23 04:06 qwbarch