Files
valw/nix/formatter.ulu.nix
T

23 lines
445 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 .jj . "$@" \
| xargs -r nixfmt
'';
};
};
}