mirror of
https://github.com/elwrcl/copnix.git
synced 2026-10-31 06:18:03 +03:00
flake: add nixfmt formatter
This commit is contained in:
1 parent
fde7614c99
commit
1eb65385ed
1 file changed
+22
@@ -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
|
||||
'';
|
||||
};
|
||||
};
|
||||
}
|
||||
Reference in new issue
Block a user