From 1eb65385ed2ddb7a87d1854f301956c8b825250d Mon Sep 17 00:00:00 2001 From: elwrcl Date: Mon, 7 Sep 2026 15:52:59 +0300 Subject: [PATCH] flake: add nixfmt formatter --- modules/formatter.ulu.nix | 22 +++++++++++++++++++ .../home/vscode/home-vscode-panels.ulu.nix | 2 +- 2 files changed, 23 insertions(+), 1 deletion(-) create mode 100644 modules/formatter.ulu.nix diff --git a/modules/formatter.ulu.nix b/modules/formatter.ulu.nix new file mode 100644 index 0000000..bcf7dc1 --- /dev/null +++ b/modules/formatter.ulu.nix @@ -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 + ''; + }; + }; +} diff --git a/modules/home/vscode/home-vscode-panels.ulu.nix b/modules/home/vscode/home-vscode-panels.ulu.nix index a81ccd9..3062956 100644 --- a/modules/home/vscode/home-vscode-panels.ulu.nix +++ b/modules/home/vscode/home-vscode-panels.ulu.nix @@ -15,7 +15,7 @@ when = "sideBarFocus && activeViewlet == 'workbench.view.explorer'"; } - # alt+space — terminal + # alt+space — terminal { key = "alt+space"; command = "workbench.action.terminal.toggleTerminal";