There are numerous options for using nix with Haskell, which themselves have numerous options:
generate with cabal2nix per 15.9.3.1. How to build a stand-alone project
Sadly, there aren’t instructions on adding a source override for this method and it instead switches to using developPackage
use developPackage
per 15.9.4.4. How to specify source overrides for your Haskell package
#...
# pinning nixpkgs using new Nix 2.0 builtin `fetchGit`
pkgs = import (fetchGit (import ./version.nix)) { };
#...
searching nix 2.0 fetchgit version.nix doesn’t result in anything useful for me
searching github for filename:version.nix doesn’t help me figure out how to write the file
how do you create a version.nix file that works with this example from the nix manual?
Even with Nix integration enabled, Stack will still build all of your project’s Haskell dependencies itself, rather than using the Nix cache. - Typeclasses.com on stack –nix
Why? 2 reasons:
- You really like stack’s UX or your team prefers it’s ux:
- You want to download cached Haskell packages rather than rebuilding them