Open
Description
Hello - you may already be aware of this, but there's two ways in which the stack/nix infrastructure can go wrong:
- The nix expression generated in
src/Stack/Nix.hs
useswith (import <nixpkgs> {})
- this then relies on the state on the user's machine. This<nixpkgs>
will be the nixpkgs in the$NIX_PATH
, which might be quite out of date since many people have moved over wholesale to flakes these days. - The
nixCompilerVersion
function insrc/Stack/Config.Nix.hs
will (not unreasonably) look for a ghc version innixpkgs
that has the name formathaskell.compiler.ghc<major><minor><patch>
, likehaskell.compiler.ghc964
. This should work except that the ghc versions in nixpkgs don't always seem to adhere to this format, eghaskell.compiler.ghc96
is ghc 9.6.4, andhaskell.compiler.ghc964
doesn't exist.
I'm not sure what the best solution to this is, it might be worth storing a map from resolver -> (nixpkgs commit, nixpkgs ghc package name) in the source code, and then falling back to using the existing approach if a resolver is requested that isn't in the map.