about summary refs log tree commit diff
path: root/checks.nix
blob: 33ab57e0f402476c1508951fe4ea294f74db5da9 (plain) (blame)
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
{
  inputs,
  pkgs,
  system,
  ...
}:
{
  git-hooks = inputs.git-hooks.lib.${system}.run {
    src = builtins.path {
      name = "src";
      path = ./.;
    };
    hooks = {
      nixfmt = {
        enable = true;
        package = pkgs.nixfmt;
      };
      promtool = {
        enable = true;
        name = "promtool";
        description = "Check Prometheus rules";
        entry = "${pkgs.prometheus.cli}/bin/promtool check rules";
        files = "(?x)^(modules/monitoring/rules/.*\.yaml)$";
      };
      trim-trailing-whitespace = {
        enable = true;
        excludes = [ ".*\.patch" ];
      };
      check-added-large-files.enable = true;
      check-case-conflicts.enable = true;
      check-symlinks.enable = true;
      deadnix.enable = true;
      detect-private-keys.enable = true;
      editorconfig-checker.enable = true;
      fix-byte-order-marker.enable = true;
      flake-checker.enable = true;
      nil.enable = true;
      prettier.enable = true;
      shellcheck.enable = true;
      shfmt.enable = true;
      statix.enable = true;
      yamllint.enable = true;
    };
  };
}
// inputs.self.packages.${system}

Consider giving Nix/NixOS a try! <3