From 4389f229a50303b75fe8966c828fa10f635f42a7 Mon Sep 17 00:00:00 2001 From: Alexander Heldt Date: Sat, 9 Sep 2023 10:12:44 +0200 Subject: [PATCH] pinwheel: Add `nix-mode` and hook it up with `eglot` --- hosts/pinwheel/configuration.nix | 1 + hosts/pinwheel/modules/emacs/config.org | 12 ++++++++++++ hosts/pinwheel/modules/nix/default.nix | 6 ++++++ 3 files changed, 19 insertions(+) create mode 100644 hosts/pinwheel/modules/nix/default.nix diff --git a/hosts/pinwheel/configuration.nix b/hosts/pinwheel/configuration.nix index bf0460c..f9e46fd 100644 --- a/hosts/pinwheel/configuration.nix +++ b/hosts/pinwheel/configuration.nix @@ -26,6 +26,7 @@ ./modules/firefox ./modules/calibre ./modules/go + ./modules/nix ]; nix.settings.experimental-features = [ "nix-command" "flakes" ]; diff --git a/hosts/pinwheel/modules/emacs/config.org b/hosts/pinwheel/modules/emacs/config.org index 313c783..886a0fb 100644 --- a/hosts/pinwheel/modules/emacs/config.org +++ b/hosts/pinwheel/modules/emacs/config.org @@ -398,6 +398,9 @@ https://github.com/justbur/emacs-which-key ) (use-package eglot + :config + ;; Ensure `nil` is in your PATH. + (add-to-list 'eglot-server-programs '(nix-mode . ("nil"))) :hook ( (eglot-managed-mode . alex/eglot-on-save) (go-mode . eglot-ensure) @@ -413,3 +416,12 @@ https://github.com/justbur/emacs-which-key ) ) #+END_SRC +** Nix +#+BEGIN_SRC emacs-lisp + (use-package nix-mode + :mode "\\.nix$" + :hook ( + (nix-mode . eglot-ensure) + ) + ) +#+END_SRC diff --git a/hosts/pinwheel/modules/nix/default.nix b/hosts/pinwheel/modules/nix/default.nix new file mode 100644 index 0000000..bf95786 --- /dev/null +++ b/hosts/pinwheel/modules/nix/default.nix @@ -0,0 +1,6 @@ +{ pkgs, ... }: +{ + home-manager.users.alex = { + home.packages = [ pkgs.nil ]; + }; +}