5cfb230f15
Also use check-flake for .#check package. Deal with network access by disabling sandbox, and excluding in garnix.
38 lines
1.2 KiB
Nix
38 lines
1.2 KiB
Nix
{
|
|
description = "srid/haskell-template: Nix template for Haskell projects";
|
|
inputs = {
|
|
nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable";
|
|
flake-parts.url = "github:hercules-ci/flake-parts";
|
|
flake-parts.inputs.nixpkgs.follows = "nixpkgs";
|
|
haskell-flake.url = "github:srid/haskell-flake";
|
|
treefmt-flake.url = "github:srid/treefmt-flake";
|
|
check-flake.url = "github:srid/check-flake";
|
|
};
|
|
|
|
outputs = inputs@{ self, nixpkgs, flake-parts, ... }:
|
|
flake-parts.lib.mkFlake { inherit self; } {
|
|
systems = nixpkgs.lib.systems.flakeExposed;
|
|
imports = [
|
|
inputs.haskell-flake.flakeModule
|
|
inputs.treefmt-flake.flakeModule
|
|
inputs.check-flake.flakeModule
|
|
];
|
|
perSystem = { self', config, pkgs, ... }: {
|
|
haskellProjects.default = {
|
|
root = ./.;
|
|
buildTools = hp: {
|
|
inherit (pkgs)
|
|
treefmt;
|
|
} // config.treefmt.formatters;
|
|
enableHLSCheck = true;
|
|
};
|
|
treefmt.formatters = {
|
|
inherit (pkgs)
|
|
nixpkgs-fmt;
|
|
inherit (pkgs.haskellPackages)
|
|
cabal-fmt
|
|
fourmolu;
|
|
};
|
|
};
|
|
};
|
|
}
|