build: add Bazel Rust workflow
This commit was merged in pull request #2.
This commit is contained in:
35
configs/nixos/modules/shell/rust.nix
Normal file
35
configs/nixos/modules/shell/rust.nix
Normal file
@@ -0,0 +1,35 @@
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
# Rust tools for the primary user's shell environment.
|
||||
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 = [
|
||||
toolchain
|
||||
pkgs.rust-analyzer
|
||||
];
|
||||
|
||||
home.sessionVariables.RUST_TOOLCHAIN_ROOT = "${toolchain}";
|
||||
};
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user