A flake-parts module for Haskell development, originally extracted from haskell-template
.
haskell-flake
-
Philosophy
I wish to keep all the Nix code (
flake.nix
) as small and simple as possible. This is why much of the Nix is delegated tohaskell-flake
. Consequently, it also becomes easier for the user to do some Nix-based Haskell workflows (I’m yet to document these). -
Flake checks for Haskell
haskell-flake
provides a builtin list of flake checks that you can manually enable: -
Adding library dependencies
Build it using
callCabal2nix
and assign it to theema
name in the Haskell package set by adding it to theoverrides
argument of yourflake.nix
that is usinghaskell-flake
:Step (3) above will try to fetch the package from the Haskell package set in nixpkgs (the one that is pinned in
flake.lock
), and this package set (which is ultimately derived from Stackage sets) sometimes may not have the package you are looking for. A common reason is that it is marked as “broken” or it simply doesn’t exist. In such cases, you will have to override the package in theoverrides
argument ofhaskell-flake
(see the next section).