-
Notifications
You must be signed in to change notification settings - Fork 0
/
flake.nix
53 lines (46 loc) · 1.25 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
{
description = "NAHO's Advent of Code solutions";
inputs = {
flakeUtils.url = "github:numtide/flake-utils";
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
preCommitHooks = {
inputs = {
flake-utils.follows = "flakeUtils";
nixpkgs-stable.follows = "preCommitHooks/nixpkgs";
nixpkgs.follows = "nixpkgs";
};
url = "github:trueNAHO/pre-commit-hooks.nix/fix-typos-force-exclude";
};
};
outputs = {
self,
flakeUtils,
nixpkgs,
preCommitHooks,
...
}:
flakeUtils.lib.eachDefaultSystem (
system: let
pkgs = nixpkgs.legacyPackages.${system};
in {
checks.preCommitHooks = preCommitHooks.lib.${system}.run {
hooks = {
alejandra.enable = true;
convco.enable = true;
rustfmt.enable = true;
typos.enable = true;
yamllint.enable = true;
};
settings = {
alejandra.verbosity = "quiet";
typos.exclude = "*.txt";
};
src = ./.;
};
devShells.default = pkgs.mkShell {
inherit (self.checks.${system}.preCommitHooks) shellHook;
packages = with pkgs; [cargo-watch rustup];
};
}
);
}