Files
copnix/modules/formatter.ulu.nix
2026-09-07 16:01:55 +03:00

23 lines
460 B
Nix

{ ... }:
{
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
'';
};
};
}