From 74916461305082a6d5c32c4d22ebfcee51db76c7 Mon Sep 17 00:00:00 2001 From: Erwin Boskma Date: Tue, 23 May 2023 11:09:55 +0200 Subject: [PATCH] emacs: Configure formatter for nil --- home-manager/modules/emacs/config.org | 9 +++++++++ home-manager/modules/emacs/default.nix | 1 + 2 files changed, 10 insertions(+) diff --git a/home-manager/modules/emacs/config.org b/home-manager/modules/emacs/config.org index 0526809..c78ce39 100644 --- a/home-manager/modules/emacs/config.org +++ b/home-manager/modules/emacs/config.org @@ -1371,6 +1371,15 @@ Add [[https://github.com/NixOS/nix-mode][nix-mode]] :hook (nix-mode . eglot-ensure)) #+end_src +Tell =nil= to use =nixpkgs-fmt= for formatting nix files. + +#+begin_src emacs-lisp + (with-eval-after-load 'eglot + (add-to-list 'eglot-server-programs + '(nix-mode . ("nil" :initializationOptions + `(:nil (:formatting (:command ("nixpkgs-fmt")))))))) +#+end_src + *** Common Lisp Common Lisp does not use =lsp-mode=, but has it's own environment: [[https://github.com/slime/slime][SLIME]] or Superior Lisp Interaction Mode for Emacs. diff --git a/home-manager/modules/emacs/default.nix b/home-manager/modules/emacs/default.nix index 5df8386..5d195a3 100644 --- a/home-manager/modules/emacs/default.nix +++ b/home-manager/modules/emacs/default.nix @@ -79,6 +79,7 @@ in nodePackages.bash-language-server aspell nil + nixpkgs-fmt python3 lldb ] ++