haskell-template
provides a builtin list of flake checks:
-
haskell-language-server check (
hlsCheck.enable = true
) fromhaskell-flake
: Tests that HLS continues to work with the project. - treefmt check: Tests that the project is autoformatted and does not have any hlint warnings.
nix flake check
and IFD
You cannot use nix flake check
(unless your systems
list is singular) due to IFD. You can work around this by using the check-flake flake-parts module; make the following changes to your flake.nix
:
-
Add
check-flake.url = "github:srid/check-flake";
to “inputs” -
Add
inputs.check-flake.flakeModule
to “imports”
Now you can run the following command 1 to run all flake checks locally for the current system:
nix --option sandbox false build .#check -L
See also
sandbox is being disabled because of an issue with haskell-language-server.