summaryrefslogtreecommitdiff
path: root/dev
diff options
context:
space:
mode:
authorseth <[email protected]>2024-07-16 19:04:27 -0400
committerseth <[email protected]>2024-07-16 22:24:21 -0400
commit2e7e1ce219b43bb74f67875200dd4b68758ffd27 (patch)
tree11ca91f55aa47c5b341aaf65f3626c9681a22b07 /dev
parent255e7c40af44aeedf19a3ca682cfc8a098266e8a (diff)
back to nixvim againnixvim-again
Diffstat (limited to 'dev')
-rw-r--r--dev/checks.nix45
-rw-r--r--dev/default.nix12
-rw-r--r--dev/devShell.nix15
3 files changed, 72 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
+ '';
+ };
+ };
+}
diff --git a/dev/default.nix b/dev/default.nix
new file mode 100644
index 0000000..eff9cc3
--- /dev/null
+++ b/dev/default.nix
@@ -0,0 +1,12 @@
+{
+ imports = [
+ ./checks.nix
+ ./devShell.nix
+ ];
+
+ perSystem =
+ { pkgs, ... }:
+ {
+ formatter = pkgs.nixfmt-rfc-style;
+ };
+}
diff --git a/dev/devShell.nix b/dev/devShell.nix
new file mode 100644
index 0000000..7792817
--- /dev/null
+++ b/dev/devShell.nix
@@ -0,0 +1,15 @@
+{
+ perSystem =
+ { pkgs, self', ... }:
+ {
+ devShells.default = pkgs.mkShellNoCC {
+ packages = [
+ pkgs.actionlint
+
+ self'.formatter
+ pkgs.nil
+ pkgs.statix
+ ];
+ };
+ };
+}