all repos — nixfiles @ aa29d2164a652aa53e048f6acaeacc2e13e41efe

System and user configuration, managed by nix and home-manager

Add support for developing in Nim
Alan Pearce alan@alanpearce.eu
Wed, 06 Dec 2023 22:31:58 +0100
commit

aa29d2164a652aa53e048f6acaeacc2e13e41efe

parent

825e49acad8a4c0f85169c9d9e47647c07e12a0f

4 files changed, 23 insertions(+), 0 deletions(-)

jump to
M user/emacs/init.eluser/emacs/init.el
@@ -748,6 +748,13 @@ (use-package go-mode   :defer t)
 (add-to-list 'major-mode-remap-alist '(go-mode . go-ts-mode))
 
+;;;; nim
+(use-package nim-mode
+  :defer t
+  :config (progn
+            (add-to-list 'eglot-server-programs
+                         '(nim-mode "nimlsp"))))
+
 ;;;; rust
 (use-package rustic
   :mode (("\\.rs\\'" . rustic-mode))
@@ -1045,6 +1052,7 @@ js-ts-mode-hook             css-ts-mode-hook
             go-ts-mode-hook
             lua-mode-hook
+            nim-mode-hook
             scss-mode-hook
             html-mode-hook
             nix-mode-hook
M user/mba.nixuser/mba.nix
@@ -3,6 +3,7 @@ imports = [     ./settings/base.nix
     ./settings/development/base.nix
     ./settings/development/javascript.nix
+    ./settings/development/nim.nix
     ./settings/development/web.nix
     ./settings/darwin.nix
     ./settings/emacs.nix
M user/prefect.nixuser/prefect.nix
@@ -10,6 +10,7 @@ ./settings/development/base.nix     ./settings/development/clojure.nix
     ./settings/development/lisp.nix
     ./settings/development/javascript.nix
+    ./settings/development/nim.nix
     ./settings/development/rust.nix
     ./settings/development/web.nix
     ./settings/fish.nix
A user/settings/development/nim.nix
@@ -0,0 +1,13 @@+{ config
+, pkgs
+, ...
+}: {
+  home.packages = with pkgs; [
+    nim
+    nimble
+    nimlsp
+  ];
+  programs.emacs.extraPackages = epkgs: (with epkgs; [
+    nim-mode
+  ]);
+}