about summary refs log tree commit diff
path: root/home/rust/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'home/rust/default.nix')
-rw-r--r--home/rust/default.nix17
1 files changed, 17 insertions, 0 deletions
diff --git a/home/rust/default.nix b/home/rust/default.nix
new file mode 100644
index 0000000..2fe5053
--- /dev/null
+++ b/home/rust/default.nix
@@ -0,0 +1,17 @@
+{ lib, config, pkgs, ... }:
+let cfg = config.my.home.rust;
+in
+{
+  options.my.home.rust = with lib; {
+    enable = mkEnableOption "rust configuration";
+  };
+
+  config = lib.mkIf cfg.enable {
+    home.packages = with pkgs; [
+      rust-bin.beta.latest.default
+      rust-analyzer
+    ];
+    home.sessionVariables.CARGO_HOME = "${config.xdg.dataHome}/cargo";
+    home.sessionPath = [ "$CARGO_HOME/bin" ];
+  };
+}