diff options
author | Azat Bahawi <azat@bahawi.net> | 2023-11-13 10:40:41 +0300 |
---|---|---|
committer | Azat Bahawi <azat@bahawi.net> | 2023-11-13 10:40:41 +0300 |
commit | a3f9fde2a2d43dd477f402bd4b8df2a1cd29ca43 (patch) | |
tree | cbd0c2457daa6865eb33b5389ec40309e60868a9 /checks.nix | |
parent | 2023-11-12 (diff) |
2023-11-13
Diffstat (limited to '')
-rw-r--r-- | checks.nix | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/checks.nix b/checks.nix new file mode 100644 index 0000000..2d60a1c --- /dev/null +++ b/checks.nix @@ -0,0 +1,40 @@ +{ + system, + inputs, + lib, +}: let + pkgs = inputs.self.legacyPackages.${system}; +in { + preCommit = inputs.pre-commit-hooks.lib.${system}.run { + src = builtins.path { + name = "nixfiles"; + path = ./.; + }; + hooks = { + alejandra.enable = true; + deadnix.enable = true; + editorconfig-checker.enable = true; + prettier = { + enable = true; + files = "\\.css"; + }; + shellcheck.enable = true; + shfmt.enable = true; + statix.enable = true; + typos = { + enable = true; + types = ["text"]; + pass_filenames = false; + }; + yamllint.enable = true; + promtool = { + enable = true; + name = "promtool"; + description = "Check Prometheus rules"; + entry = "${pkgs.prometheus.cli}/bin/promtool check rules"; + files = "(?x)^(modules/nixos/monitoring/rules/.*\.yaml)$"; + }; + }; + settings.deadnix.edit = true; + }; +} |