about summary refs log tree commit diff
path: root/checks.nix
diff options
context:
space:
mode:
authorAzat Bahawi <azat@bahawi.net>2024-03-31 21:29:27 +0300
committerAzat Bahawi <azat@bahawi.net>2024-03-31 21:29:27 +0300
commit9a5427e3a0c0ccf2a82dc503149a26b23fbd6004 (patch)
treef28beec29deeea36038615a8fb98a810891940b5 /checks.nix
parent2024-03-19 (diff)
2024-03-31
Diffstat (limited to '')
-rw-r--r--checks.nix25
1 files changed, 15 insertions, 10 deletions
diff --git a/checks.nix b/checks.nix
index 142ad1d..f9949e3 100644
--- a/checks.nix
+++ b/checks.nix
@@ -1,28 +1,34 @@
-{
-  inputs,
-  system,
-}: let
+{ inputs, system }:
+with inputs.nixpkgs.lib;
+let
   pkgs = inputs.self.legacyPackages.${system};
-in {
+in
+{
   preCommit = inputs.pre-commit.lib.${system}.run {
     src = builtins.path {
       name = "nixfiles";
       path = ./.;
     };
     hooks = {
-      alejandra.enable = true;
-      deadnix.enable = true;
+      nixfmt = {
+        enable = true;
+        package = pkgs.nixfmt;
+      };
+      deadnix = {
+        enable = true;
+        settings.edit = true;
+      };
       editorconfig-checker.enable = true;
       prettier = {
         enable = true;
-        files = "\\.css";
+        types_or = mkForce [ "css" ];
       };
       shellcheck.enable = true;
       shfmt.enable = true;
       statix.enable = true;
       typos = {
         enable = true;
-        types = ["text"];
+        types = [ "text" ];
         pass_filenames = false;
       };
       yamllint.enable = true;
@@ -34,6 +40,5 @@ in {
         files = "(?x)^(modules/nixos/monitoring/rules/.*\.yaml)$";
       };
     };
-    settings.deadnix.edit = true;
   };
 }

Consider giving Nix/NixOS a try! <3