summaryrefslogtreecommitdiff
path: root/dev/checks.nix
diff options
context:
space:
mode:
authorseth <[email protected]>2024-07-05 07:01:21 -0400
committerseth <[email protected]>2024-07-09 15:38:51 -0400
commitbe286a453d1902af09431f28a5a02a8c00a954ea (patch)
treee0b774db2066c08a095ca827c14ccc96d6654b18 /dev/checks.nix
parent1f7efe32e4dd69db644568a0a1d36cd01cfd6233 (diff)
tree-wide: move dev outputs to dev/
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
+ '';
+ };
+ };
+}