diff --git a/flake.nix b/flake.nix index 5fd9b732..6e58193f 100644 --- a/flake.nix +++ b/flake.nix @@ -91,18 +91,29 @@ # Check if codebase is properly formatted. # This can be initiated with `nix build .#checks..nix-fmt` # or with `nix flake check` - nix-fmt = pkgs.runCommand "nix-fmt-check" {nativeBuildInputs = [pkgs.alejandra];} '' - alejandra --check ${self} < /dev/null - touch $out - ''; + nix-fmt = + pkgs.runCommand "nix-fmt-check" + { + src = self; + nativeBuildInputs = [pkgs.alejandra pkgs.fd]; + } '' + cd "$src" + fd -t f -e nix -x alejandra --check '{}' + touch $out + ''; # Check if Markdown sources are properly formatted # This can be initiated with `nix build .#checks..md-fmt` # or with `nix flake check` - md-fmt = pkgs.runCommand "md-fmt-check" {nativeBuildInputs = [pkgs.deno];} '' - deno fmt --check ${self} --ext md - touch $out - ''; + md-fmt = + pkgs.runCommand "md-fmt-check" { + src = self; + nativeBuildInputs = [pkgs.deno pkgs.fd]; + } '' + cd "$src" + fd -t f -e md -x deno fmt --check '{}' + touch $out + ''; }; }; };