refactor(bazel): use configured Rust toolchain root

This commit is contained in:
2026-08-31 15:00:27 -04:00
parent 2234db4c9b
commit 85b49c5378
6 changed files with 154 additions and 155 deletions

View File

@@ -8,18 +8,28 @@
let
cfg = config.modules.shell.rust;
user = config.user.name;
toolchain = pkgs.symlinkJoin {
name = "rust-toolchain";
paths = with pkgs; [
cargo
clippy
gcc
rustc
rustfmt
];
};
in
{
options.modules.shell.rust.enable = lib.mkEnableOption "Rust tools for the primary user's shell environment";
config = lib.mkIf cfg.enable {
home-manager.users.${user}.home.packages = with pkgs; [
cargo
clippy
gcc
rust-analyzer
rustc
rustfmt
];
home-manager.users.${user} = {
home.packages = [
toolchain
pkgs.rust-analyzer
];
home.sessionVariables.RUST_TOOLCHAIN_ROOT = "${toolchain}";
};
};
}