A flake-parts
Nix module for Haskell development.
To keep flake.nix
smaller (eg.: going from this 91-line flake.nix to the 31-line one) and declarative (what vs how) by bringing NixOS module system to flakes.
To use haskell-flake in your Haskell projects, create a flake.nix
containing the following:
{
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable";
flake-parts.url = "github:hercules-ci/flake-parts";
haskell-flake.url = "github:srid/haskell-flake";
};
outputs = inputs@{ self, nixpkgs, flake-parts, ... }:
flake-parts.lib.mkFlake { inherit self; } {
systems = nixpkgs.lib.systems.flakeExposed;
imports = [ inputs.haskell-flake.flakeModule ];
perSystem = { self', pkgs, ... }: {
haskellProjects.default = {
root = ./.;
# buildTools = hp: { fourmolu = hp.fourmolu; };
# source-overrides = { };
# overrides = self: super: { };
# modifier = drv: drv;
};
};
};
}
See flake-module.nix
-> options
for a list of options available. Uses callCabal2nixWithOptions
under the hood. See #7 for future improvements.