summary refs log tree commit diff
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--emacs/custom/my-lang-nix.el21
-rw-r--r--emacs/init.el1
2 files changed, 22 insertions, 0 deletions
diff --git a/emacs/custom/my-lang-nix.el b/emacs/custom/my-lang-nix.el
new file mode 100644
index 0000000..9de5c50
--- /dev/null
+++ b/emacs/custom/my-lang-nix.el
@@ -0,0 +1,21 @@
+;;; my-lang-nix.el --- configure emacs for nix -*- lexical-binding: t -*-
+;; Author: Franck Cuny <franck@fcuny.net>
+
+;;; Commentary:
+
+;;; Code:
+
+(require 'lsp-mode)
+
+(add-to-list 'lsp-language-id-configuration '(nix-mode . "nix"))
+(lsp-register-client
+ (make-lsp-client :new-connection
+                  (lsp-stdio-connection '("rnix-lsp"))
+                  :major-modes '(nix-mode)
+                  :server-id 'nix))
+
+(add-hook 'nix-mode-hook #'lsp-deferred)
+
+(provide 'my-lang-nix)
+
+;;; my-lang-nix.el ends here
diff --git a/emacs/init.el b/emacs/init.el
index 910bae5..eec012e 100644
--- a/emacs/init.el
+++ b/emacs/init.el
@@ -54,6 +54,7 @@
 (require 'my-lang-go)
 (require 'my-lang-python)
 (require 'my-lang-rust)
+(require 'my-lang-nix)
 
 (require 'my-buffers)
 (require 'my-git-extra)