flake: add nixfmt formatter

This commit is contained in:
elwrcl committed 2026-09-07 16:01:55 +03:00
1 parent fde7614c99
commit 1eb65385ed
2 files changed
+23 -1

No files matched your search

+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
'';
};
};
}
@@ -15,7 +15,7 @@
when = "sideBarFocus && activeViewlet == 'workbench.view.explorer'";
}
# alt+space — terminal
# alt+space — terminal
{
key = "alt+space";
command = "workbench.action.terminal.toggleTerminal";