about summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--modules/by-name/ca/cargo/module.nix18
-rw-r--r--modules/common/default.nix1
2 files changed, 19 insertions, 0 deletions
diff --git a/modules/by-name/ca/cargo/module.nix b/modules/by-name/ca/cargo/module.nix
new file mode 100644
index 00000000..f7153509
--- /dev/null
+++ b/modules/by-name/ca/cargo/module.nix
@@ -0,0 +1,18 @@
+{
+  config,
+  lib,
+  ...
+}: let
+  cfg = config.soispha.programs.cargo;
+in {
+  options.soispha.programs.cargo = {
+    enable = lib.mkEnableOption "cargo";
+  };
+  config = lib.mkIf cfg.enable {
+    home-manager.users.soispha = {
+      home.sessionVariables = {
+        CARGO_HOME = "${config.home-manager.users.soispha.xdg.dataHome}/cargo";
+      };
+    };
+  };
+}
diff --git a/modules/common/default.nix b/modules/common/default.nix
index ae4dc715..4fc6bf51 100644
--- a/modules/common/default.nix
+++ b/modules/common/default.nix
@@ -105,6 +105,7 @@
         shell = pkgs.zsh;
       };
       atuin.enable = true;
+      cargo.enable = true;
       direnv.enable = true;
       git.enable = true;
       imv.enable = true;