Commit 5b4bad5588ef

Vincent Demeester <vincent@sbr.pm>
2026-01-20 12:34:49
feat(dev): add Rust development environment
- Enable Rust development on systems with comprehensive tooling - Provide rust-analyzer LSP and cargo extensions for productivity - Follow XDG standards for clean home directory organization Signed-off-by: Vincent Demeester <vincent@sbr.pm>
1 parent 7f9117f
Changed files (2)
home/common/dev/default.nix
@@ -6,6 +6,7 @@
     ./lua.nix
     ./nix.nix
     ./python.nix
+    ./rust.nix
     ./base.nix
   ]
   ++ lib.optional (builtins.isString desktop) ./desktop.nix;
home/common/dev/rust.nix
@@ -0,0 +1,31 @@
+{ config, pkgs, ... }:
+{
+  home.sessionVariables = {
+    CARGO_HOME = "${config.xdg.dataHome}/cargo";
+    RUSTUP_HOME = "${config.xdg.dataHome}/rustup";
+  };
+  home.packages = with pkgs; [
+    # Core Rust toolchain
+    rustc
+    cargo
+    rustfmt
+    clippy
+
+    # LSP and development tools
+    rust-analyzer
+
+    # Cargo extensions
+    cargo-watch # Auto-recompile on changes
+    cargo-edit # cargo add, cargo rm, cargo upgrade commands
+    cargo-outdated # Check for outdated dependencies
+    cargo-audit # Security audit for dependencies
+    cargo-expand # Expand macros
+    cargo-bloat # Find what takes most space in binary
+    cargo-udeps # Find unused dependencies
+    bacon # Background rust code checker
+
+    # Build dependencies
+    pkg-config
+    openssl
+  ];
+}