summaryrefslogtreecommitdiff
path: root/checks.nix
diff options
context:
space:
mode:
Diffstat (limited to 'checks.nix')
-rw-r--r--checks.nix37
1 files changed, 37 insertions, 0 deletions
diff --git a/checks.nix b/checks.nix
new file mode 100644
index 0000000..93d387f
--- /dev/null
+++ b/checks.nix
@@ -0,0 +1,37 @@
+self: {
+ lib,
+ runCommand,
+ system,
+ actionlint,
+ fd,
+ statix,
+ nil,
+ ...
+}: let
+ formatter = self.formatter.${system};
+in {
+ check-actionlint = runCommand "check-actionlint" {} ''
+ ${lib.getExe actionlint} ${./.github/workflows}/*
+
+ touch $out
+ '';
+
+ check-nil = runCommand "check-nil" {} ''
+ cd ${./.}
+ ${lib.getExe fd} . -e 'nix' | while read -r file; do
+ ${lib.getExe nil} diagnostics "$file"
+ done
+
+ touch $out
+ '';
+
+ check-statix = runCommand "check-statix" {} ''
+ ${lib.getExe statix} check ${./.}
+ touch $out
+ '';
+
+ "check-${formatter.pname}" = runCommand "check-${formatter.pname}" {} ''
+ ${lib.getExe formatter} --check ${./.}
+ touch $out
+ '';
+}