diff options
Diffstat (limited to 'checks.nix')
| -rw-r--r-- | checks.nix | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/checks.nix b/checks.nix new file mode 100644 index 0000000..a21986a --- /dev/null +++ b/checks.nix @@ -0,0 +1,51 @@ +{ + lib, + inputs, + self, + ... +}: + +let + collectNestedDerivationsIn = lib.foldlAttrs ( + acc: attrType: values: + + acc // lib.mapAttrs' (attrName: lib.nameValuePair "${attrType}-${attrName}") values + ) { }; +in + +{ + imports = [ inputs.getchpkgs.flakeModules.checks ]; + + perSystem = + { + pkgs, + system, + self', + ... + }: + + lib.mkMerge [ + { + checks = collectNestedDerivationsIn { inherit (self') devShells packages; }; + } + + (lib.mkIf (system == "x86_64-linux") { + quickChecks = { + deadnix = { + dependencies = [ pkgs.deadnix ]; + script = "deadnix --fail ${self}"; + }; + + nixfmt = { + dependencies = [ pkgs.nixfmt-rfc-style ]; + script = "nixfmt --check ${self}"; + }; + + statix = { + dependencies = [ pkgs.statix ]; + script = "statix check ${self}"; + }; + }; + }) + ]; +} |
