infinisil/all-hies

Provide an overlay

infinisil opened this issue · 5 comments

Both makes sense and makes installation simpler.

The overlay I use is just

self:
  super:
{
  all-hies = import (fetchTarball "https://github.com/infinisil/all-hies/tarball/master") {};
}

Do you have something more featureful in mind?

I'd have the overlay define hie or haskell-ide-engine as the attribute name, since that's what the package should really be called.

And of course the overlay in this repo would use the expressions defined within directly, instead of fetching the repo again. Use would look like

{
  nixpkgs.overlays = [
    (import (fetchTarball "https://github.com/infinisil/all-hies/tarball/master" + "/overlay.nix"))
  ];
  
  environment.systemPackages = with pkgs; [
    (hie.selection { selector = p: { inherit (p) ghc844 ghc864; }; })
  ];
}

Or actually even better, use NUR

And even better on NixOS, a module like this:

{
  imports = [
    (import (fetchTarball "https://github.com/infinisil/all-hies/tarball/master" + "/module.nix"))
  ];

  programs.hie = {
    enable = true;
    ghcVersions = [ "ghc864" "ghc865" ];
    fallbackToUnstable = true;
  };
}

Then this can guarantee that only one combined version of HIE gets installed but you can still add additional versions from different files.

Ohh and actually, an overlay can do something really fancy: It can add the correct HIE version to all haskell package sets! So you'd have a correct HIE under pkgs.haskell.packages.ghc864.haskell-ide-engine and the same for all others.

Now done with #64