-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathflake.nix
56 lines (53 loc) · 1.45 KB
/
flake.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
{
description = "A collection of flake templates";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs";
flake-utils.url = "github:numtide/flake-utils";
pre-commit-hooks.url = "github:cachix/pre-commit-hooks.nix";
pre-commit-hooks.inputs.nixpkgs.follows = "nixpkgs";
};
outputs = {
self,
nixpkgs,
flake-utils,
pre-commit-hooks,
}: let
pkgsFor = system: import nixpkgs {inherit system;};
in
flake-utils.lib.eachDefaultSystem (
system: let
pkgs = pkgsFor system;
precommitCheck = pre-commit-hooks.lib.${system}.run {
src = ./.;
hooks = {
actionlint.enable = true;
markdownlint.enable = true;
nil.enable = true;
alejandra.enable = true;
statix.enable = true;
};
};
in {
devShells.default = pkgs.mkShell {
inherit (precommitCheck) shellHook;
buildInputs = with pkgs; [
actionlint
alejandra
nil
statix
];
};
checks = {pre-commit-check = precommitCheck;};
}
)
// {
templates.haskell = {
path = ./haskell;
description = "Template for a haskell CLI application";
};
nixConfig = {
extra-substituters = "https://opensource.cachix.org";
extra-trusted-public-keys = "opensource.cachix.org-1:6t9YnrHI+t4lUilDKP2sNvmFA9LCKdShfrtwPqj2vKc=";
};
};
}