From 850dda12ae44888f3769851fd1c1b4a6bb0bf3aa Mon Sep 17 00:00:00 2001 From: Yuval Kogman Date: Fri, 3 Jan 2025 02:11:42 +0100 Subject: [PATCH] flake: check shell script formatting with shfmt --- flake.nix | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/flake.nix b/flake.nix index 512ce03a..5135c6b5 100644 --- a/flake.nix +++ b/flake.nix @@ -162,6 +162,15 @@ alejandra -c . ''; }; + + shfmt = simpleCheck rec { + name = "shell-checks"; + src = pkgs.lib.sources.sourceFilesBySuffices ./. [".sh"]; + nativeBuildInputs = [pkgs.shfmt]; + checkPhase = '' + shfmt -d -s -i 4 -ci ${src} + ''; + }; }; } );