summaryrefslogtreecommitdiff
path: root/dev/checks.nix
diff options
context:
space:
mode:
Diffstat (limited to 'dev/checks.nix')
-rw-r--r--dev/checks.nix45
1 files changed, 45 insertions, 0 deletions
diff --git a/dev/checks.nix b/dev/checks.nix
new file mode 100644
index 0000000..533c2a0
--- /dev/null
+++ b/dev/checks.nix
@@ -0,0 +1,45 @@
+{
+ perSystem =
+ { lib, pkgs, ... }:
+ let
+ root = lib.fileset.toSource {
+ root = ../.;
+ fileset = lib.fileset.unions [
+ ./.
+ ../.github
+ ../nixvim
+ ../flake.nix
+ ];
+ };
+ in
+ {
+ checks = {
+ format-and-lint =
+ pkgs.runCommand "format-and-lint"
+ {
+ src = root;
+ nativeBuildInputs = [
+ pkgs.actionlint
+ pkgs.deadnix
+ pkgs.nixfmt-rfc-style
+ pkgs.statix
+ ];
+ }
+ ''
+ echo "running actionlint..."
+ actionlint ./.github/workflows/*
+
+ echo "running deadnix..."
+ deadnix
+
+ echo "running nixfmt..."
+ nixfmt --check .
+
+ echo "running statix..."
+ statix check .
+
+ touch $out
+ '';
+ };
+ };
+}