summary refs log tree commit diff stats
path: root/user/emacs
diff options
context:
space:
mode:
authorAlan Pearce2024-05-03 11:49:16 +0200
committerAlan Pearce2024-05-03 11:50:40 +0200
commitfcd836ae5ddc810618e66a836fd5dfac84ba146f (patch)
tree7e808b0627b8d73b75034c60962ebc38a1310ac6 /user/emacs
parent43b455c8f9aa26c611e5089e8e4ac3632298f93a (diff)
downloadnixfiles-fcd836ae5ddc810618e66a836fd5dfac84ba146f.tar.lz
nixfiles-fcd836ae5ddc810618e66a836fd5dfac84ba146f.tar.zst
nixfiles-fcd836ae5ddc810618e66a836fd5dfac84ba146f.zip
emacs: be explicit about using nixpkgs-fmt
Diffstat (limited to 'user/emacs')
-rw-r--r--user/emacs/init.el5
1 files changed, 3 insertions, 2 deletions
diff --git a/user/emacs/init.el b/user/emacs/init.el
index 670334f3..ad8e6346 100644
--- a/user/emacs/init.el
+++ b/user/emacs/init.el
@@ -1103,10 +1103,11 @@ _C-k_: prev  _u_pper              _=_: upper/lower       _s_mart resolve
   :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)))