From 68018b83f2ae8d5e5c065b0e2b7dfa5589cb5718 Mon Sep 17 00:00:00 2001 From: MasterEnderman Date: Sun, 9 Aug 2026 15:26:52 +0200 Subject: [PATCH] added cargo Signed-off-by: MasterEnderman --- home/console/cargo.nix | 40 ++++++++++++++++++++++++++++++++++++++++ modules/user.nix | 1 + 2 files changed, 41 insertions(+) create mode 100644 home/console/cargo.nix diff --git a/home/console/cargo.nix b/home/console/cargo.nix new file mode 100644 index 0000000..213bd9c --- /dev/null +++ b/home/console/cargo.nix @@ -0,0 +1,40 @@ +{ + config, + lib, + pkgs, + inputs, + ... +}: { + options.modules.terminal.cargo = { + enable = lib.mkOption { + default = config.modules.terminal.enable; + description = "Rust toolchain (cargo, rustc) and cargo configuration"; + type = lib.types.bool; + }; + withAnalyzer = lib.mkOption { + default = true; + description = "Include rust-analyzer for LSP support (e.g. in Helix)"; + type = lib.types.bool; + }; + }; + + config = lib.mkIf config.modules.terminal.cargo.enable { + home.packages = with pkgs; + [pkg-config] ++ lib.optional config.modules.terminal.cargo.withAnalyzer rust-analyzer; + + programs.cargo = { + enable = true; + package = pkgs.cargo; + + settings = { + build.rustc = lib.getExe pkgs.rustc; + doc.browser = lib.getExe inputs.zen-browser.packages.${pkgs.system}.default; + net.git-fetch-with-cli = true; + term = { + color = "auto"; + progress.when = "auto"; + }; + }; + }; + }; +} diff --git a/modules/user.nix b/modules/user.nix index f39a2f4..aaf9b47 100644 --- a/modules/user.nix +++ b/modules/user.nix @@ -38,6 +38,7 @@ in { "Projects" "Vault" # Misc + ".cargo" ".gradle" ".config/millennium" ".config/vesktop" -- 2.51.2