flake: add nixfmt formatter

This commit is contained in:
elwrcl committed 2026-09-07 16:01:55 +03:00
1 parent fde7614c99
commit 1eb65385ed
1 file changed
+22
+22
View File
@@ -0,0 +1,22 @@
{ ... }:
{
perSystem =
{ pkgs, ... }:
{
formatter = pkgs.writeShellApplication {
name = "nixfmt-tree";
runtimeInputs = [
pkgs.nixfmt
pkgs.fd
pkgs.findutils
];
text = ''
if [ "$#" -eq 0 ]; then
set -- .
fi
fd --type f --extension nix --hidden --exclude .git --exclude .jj . "$@" \
| xargs -r nixfmt
'';
};
};
}