Install nil as a langserver for nix
Alan Pearce alan@alanpearce.eu
Tue, 14 Mar 2023 20:07:16 +0100
3 files changed, 9 insertions(+), 0 deletions(-)
M user/emacs/init.el → user/emacs/init.el
@@ -1030,10 +1030,12 @@ css-mode-hook go-mode-hook scss-mode-hook html-mode-hook + nix-mode-hook haskell-mode-hook) #'eglot-ensure) :config (progn (add-to-list 'eglot-stay-out-of 'company) + (add-to-list 'eglot-server-programs '(nix-mode . ("nil"))) (defun my/setup-eglot-eldoc () (push 'flymake-eldoc-function eldoc-documentation-functions)) (add-hook 'eglot-managed-mode-hook 'my/setup-eglot-eldoc)))
M user/settings/base.nix → user/settings/base.nix
@@ -33,6 +33,12 @@ enable = true; settings = { "json.enable" = true; "suggest.enablePreview" = true; + languageserver = { + nix = { + command = "${pkgs.nil}/bin/nil"; + filetypes = [ "nix" ]; + }; + }; }; }; };
M user/settings/nix.nix → user/settings/nix.nix
@@ -5,6 +5,7 @@ ... }: { nixpkgs.config = import ../config.nix; home.packages = with pkgs; [ + nil nix-prefetch-scripts alejandra # nix formatter ];