From 2e7e1ce219b43bb74f67875200dd4b68758ffd27 Mon Sep 17 00:00:00 2001 From: seth Date: Tue, 16 Jul 2024 19:04:27 -0400 Subject: back to nixvim again --- dev/checks.nix | 45 +++++++++++++++++++++++++++++++++++++++++++++ dev/default.nix | 12 ++++++++++++ dev/devShell.nix | 15 +++++++++++++++ 3 files changed, 72 insertions(+) create mode 100644 dev/checks.nix create mode 100644 dev/default.nix create mode 100644 dev/devShell.nix (limited to 'dev') 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 + ]; + }; + }; +} -- cgit v1.2.3