all repos — nixfiles @ fcd836ae5ddc810618e66a836fd5dfac84ba146f

System and user configuration, managed by nix and home-manager

emacs: be explicit about using nixpkgs-fmt
Alan Pearce alan@alanpearce.eu
Fri, 03 May 2024 11:49:16 +0200
commit

fcd836ae5ddc810618e66a836fd5dfac84ba146f

parent

43b455c8f9aa26c611e5089e8e4ac3632298f93a

1 files changed, 3 insertions(+), 2 deletions(-)

jump to
M user/emacs/init.eluser/emacs/init.el
@@ -1103,10 +1103,11 @@ :ghook 'prog-mode-hook   :config (progn
             (setf (alist-get 'shfmt apheleia-formatters)
                   '("shfmt"))
-            (setf (alist-get 'nixfmt apheleia-formatters)
-                  '("nixpkgs-fmt"))
+            (setq apheleia-formatters (append apheleia-formatters '((nixpkgs-fmt "nixpkgs-fmt"))))
             (setf (alist-get 'go-ts-mode apheleia-mode-alist)
                   '(goimports))
+            (setq apheleia-mode-alist (append apheleia-mode-alist '((nix-ts-mode . nixpkgs-fmt)
+                                                                    (nix-mode . nixpkgs-fmt))))
             (add-hook 'apheleia-mode-hook #'turn-off-format-all-mode))
   :init (progn
           (apheleia-global-mode +1)))