summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorAlan Pearce2021-05-06 16:05:42 +0200
committerAlan Pearce2021-05-06 16:05:42 +0200
commitd0deb1037ba46553a02a6d7d84b6abb5d4b6bbd8 (patch)
treec8d159cbe1d1675e7b90613c03c0db831935e1a2
parentfcee2cdf9c5e904eed5724028ad6531a105e6406 (diff)
downloadnixfiles-d0deb1037ba46553a02a6d7d84b6abb5d4b6bbd8.tar.lz
nixfiles-d0deb1037ba46553a02a6d7d84b6abb5d4b6bbd8.tar.zst
nixfiles-d0deb1037ba46553a02a6d7d84b6abb5d4b6bbd8.zip
Create initial rust development setup
-rw-r--r--user/emacs/init.el11
-rw-r--r--user/prefect.nix1
-rw-r--r--user/settings/development/rust.nix11
-rw-r--r--user/settings/emacs.nix1
4 files changed, 23 insertions, 1 deletions
diff --git a/user/emacs/init.el b/user/emacs/init.el
index 0178b3cf..5d5cded7 100644
--- a/user/emacs/init.el
+++ b/user/emacs/init.el
@@ -719,6 +719,14 @@ _p_rev       _u_pper              _=_: upper/lower       _r_esolve
                                           (set (make-local-variable 'compile-command)
                                                "go build -v && go test && go vet"))))))
 
+;;;; rust
+(use-package rustic
+  :config (progn
+            (setq rustic-format-on-save t
+                  lsp-rust-analyzer-display-inlay-hints t
+                  lsp-rust-analyzer-cargo-watch-command "clippy")
+            (add-to-list 'flycheck-checkers 'rustic-clippy)))
+
 ;;;; js
 (setq js-indent-level 2
       js-enabled-frameworks '(javascript))
@@ -925,7 +933,8 @@ _p_rev       _u_pper              _=_: upper/lower       _r_esolve
             (setq lsp-auto-guess-root t
                   lsp-auto-configure nil
                   lsp-idle-delay 0.5
-                  lsp-enable-symbol-highlighting nil)
+                  lsp-enable-symbol-highlighting nil
+                  lsp-eldoc-render-all t)
             (add-to-list 'lsp-language-id-configuration '(js-mode . "javascript"))))
 
 (use-package lsp-javascript
diff --git a/user/prefect.nix b/user/prefect.nix
index cf2e8734..662e56ff 100644
--- a/user/prefect.nix
+++ b/user/prefect.nix
@@ -10,6 +10,7 @@
     ./settings/development/clojure.nix
     ./settings/development/lisp.nix
     ./settings/development/javascript.nix
+    ./settings/development/rust.nix
     ./settings/development/web.nix
     ./settings/gaming.nix
     ./settings/git.nix
diff --git a/user/settings/development/rust.nix b/user/settings/development/rust.nix
new file mode 100644
index 00000000..6fade291
--- /dev/null
+++ b/user/settings/development/rust.nix
@@ -0,0 +1,11 @@
+{ config, pkgs, ... }:
+
+{
+  home.packages = with pkgs; [
+    cargo
+    rustc
+    rustfmt
+    rust-analyzer
+    clippy
+  ];
+}
diff --git a/user/settings/emacs.nix b/user/settings/emacs.nix
index 22537ef6..6d9f4bf0 100644
--- a/user/settings/emacs.nix
+++ b/user/settings/emacs.nix
@@ -166,6 +166,7 @@ in
       restclient
       ripgrep
       rjsx-mode
+      rustic
       scss-mode
       spacemacs-theme
       swiper