mirror of
https://github.com/elwrcl/copnix.git
synced 2026-10-31 14:28:02 +03:00
flake: add nixfmt formatter
This commit is contained in:
1 parent
fde7614c99
commit
1eb65385ed
2 files changed
+23
-1
No files matched your search
@@ -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";
|
||||
|
||||
Reference in new issue
Block a user