summary refs log tree commit diff stats
path: root/user
diff options
context:
space:
mode:
authorAlan Pearce2023-03-14 20:07:16 +0100
committerAlan Pearce2023-03-14 20:07:16 +0100
commit339a09090a926535f67f855890d97e41673f642a (patch)
tree2403195926679ed043496d2390efe5e7dd1c73a0 /user
parent9bf85a0fc518d6003943aba1bcf5637e2cda412f (diff)
downloadnixfiles-339a09090a926535f67f855890d97e41673f642a.tar.lz
nixfiles-339a09090a926535f67f855890d97e41673f642a.tar.zst
nixfiles-339a09090a926535f67f855890d97e41673f642a.zip
Install nil as a langserver for nix
Diffstat (limited to 'user')
-rw-r--r--user/emacs/init.el2
-rw-r--r--user/settings/base.nix6
-rw-r--r--user/settings/nix.nix1
3 files changed, 9 insertions, 0 deletions
diff --git a/user/emacs/init.el b/user/emacs/init.el
index 89065062..1c0d7ebe 100644
--- a/user/emacs/init.el
+++ b/user/emacs/init.el
@@ -1030,10 +1030,12 @@ _p_rev       _u_pper              _=_: upper/lower       _r_esolve
             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)))
diff --git a/user/settings/base.nix b/user/settings/base.nix
index b5ed8f0d..692369e4 100644
--- a/user/settings/base.nix
+++ b/user/settings/base.nix
@@ -33,6 +33,12 @@
       settings = {
         "json.enable" = true;
         "suggest.enablePreview" = true;
+        languageserver = {
+          nix = {
+            command = "${pkgs.nil}/bin/nil";
+            filetypes = [ "nix" ];
+          };
+        };
       };
     };
   };
diff --git a/user/settings/nix.nix b/user/settings/nix.nix
index 77fb0145..0d1f0e1c 100644
--- a/user/settings/nix.nix
+++ b/user/settings/nix.nix
@@ -5,6 +5,7 @@
 }: {
   nixpkgs.config = import ../config.nix;
   home.packages = with pkgs; [
+    nil
     nix-prefetch-scripts
     alejandra # nix formatter
   ];