summaryrefslogtreecommitdiff
path: root/dev/checks.nix
diff options
context:
space:
mode:
Diffstat (limited to 'dev/checks.nix')
-rw-r--r--dev/checks.nix42
1 files changed, 42 insertions, 0 deletions
diff --git a/dev/checks.nix b/dev/checks.nix
new file mode 100644
index 0000000..56c5038
--- /dev/null
+++ b/dev/checks.nix
@@ -0,0 +1,42 @@
+{
+ perSystem =
+ { pkgs, ... }:
+ {
+ checks = {
+ check-formatting =
+ pkgs.runCommand "check-formatting" { nativeBuildInputs = [ pkgs.nixfmt-rfc-style ]; }
+ ''
+ cd ${./.}
+
+ echo "running nixfmt..."
+ nixfmt --check .
+
+ touch $out
+ '';
+
+ check-lint =
+ pkgs.runCommand "check-lint"
+ {
+ nativeBuildInputs = [
+ pkgs.actionlint
+ pkgs.deadnix
+ pkgs.statix
+ ];
+ }
+ ''
+ cd ${./.}
+
+ echo "running actionlint..."
+ actionlint ./.github/workflows/*
+
+ echo "running deadnix..."
+ deadnix --fail
+
+ echo "running statix..."
+ statix check .
+
+ touch $out
+ '';
+ };
+ };
+}