templates/haskell/flake.nix

21 lines
553 B
Nix
Raw Normal View History

2023-10-12 22:04:55 +02:00
{
description = "A bare minimum Haskell flake";
inputs = {
flake-utils.url = "github:numtide/flake-utils";
};
outputs = { self, nixpkgs, flake-utils }:
flake-utils.lib.eachDefaultSystem (sys:
let pkgs = import nixpkgs { system = sys; };
hpkgs = pkgs.haskellPackages; # pkgs.haskell.ghc<VERSION>
project = hpkgs.callCabal2nix "my-cool-project" ./. {};
in {
packages.default = project;
devShells.default = pkgs.mkShell {
inputsFrom = [ project.env ];
};
}
);
}