summary refs log tree commit diff stats
path: root/user/emacs
diff options
context:
space:
mode:
Diffstat (limited to 'user/emacs')
-rw-r--r--user/emacs/init.el6
1 files changed, 5 insertions, 1 deletions
diff --git a/user/emacs/init.el b/user/emacs/init.el
index 8036a4dc..accc8a5b 100644
--- a/user/emacs/init.el
+++ b/user/emacs/init.el
@@ -794,7 +794,11 @@ _p_rev       _u_pper              _=_: upper/lower       _r_esolve
 
 ;;;; nix
 (with-eval-after-load 'nix-mode
-  (setq nix-indent-function #'nix-indent-line))
+  (setq nix-mode-use-smie t
+        nix-indent-function #'smie-indent-line)
+  (general-add-hook 'nix-mode-hook
+                    (lambda ()
+                      (add-hook 'before-save-hook #'nix-mode-format 0 'local))))
 
 (use-package nix-update
   :commands (nix-update-fetch))