Combining cookiecutter's Haskell template and hie

I recently read this thread and set up a new Haskell/Nix project using the cookie cutter template. Now I’d like to add haskell-ide-engine “support” for it. I tried following the instructions to install hie globally and set it to build for ghc865 via…

    ((import (fetchTarball "https://github.com/infinisil/all-hies/tarball/master") {}).selection { selector = p: { inherit (p) ghc865; }; })

…in my configuration.nix below systemPackages.

In my project, I then set the same nixpkgs rev as hie uses (just to be sure) and set compiler to ghc865. My default.nix is here. However, Nix complains about: attribute 'ghc865' missing.

Did something change with regards to the Haskell package structure that causes this?

The revision of Nixpkgs you pinned your project at is fairly old and doesn’t actually include GHC 8.6.5, only 8.6.4. Also IIRC all-hies uses a Nixpkgs pin per compiler version so perhaps you picked a wrong revision?

Ahh, thanks for the advice! So I guess the specific pin is inside the nixpkgsForGhc subfolder? I’ll try pinning to 882 and see if that works.

Indeed, although so long as the compiler version of your project and hie match I don’t think it should be necessary to pin both at exact same nixpkgs revision. Though I believe hie will pull in GHC in its own closure so you may end up with some extra duplication / used storage but I don’t think it shold cause any issues.