infrastructure/nixos/common/hm-modules/rust.nix

27 lines
606 B
Nix
Raw Normal View History

2023-11-10 23:35:26 +01:00
{ pkgs, lib, config, ... }:
with lib;
let cfg = config.programs.v.rust;
in {
options.programs.v.rust = { enable = mkEnableOption "rust"; };
config = mkIf cfg.enable {
2023-11-10 23:41:30 +01:00
home = {
2023-12-09 10:31:06 +01:00
packages = with pkgs; [ rustup cargo-nextest cargo-msrv cargo-dist cargo-cross];
2023-11-10 23:35:26 +01:00
2023-11-10 23:41:30 +01:00
file = {
".cargo/config.toml".text = ''
[registries.crates-io]
protocol = "sparse"
2023-11-10 23:35:26 +01:00
2023-11-10 23:41:30 +01:00
[build]
rustc-wrapper = "${pkgs.sccache}/bin/sccache"
2023-12-20 14:01:11 +01:00
[profile.rust-analyzer]
inherits = "dev"
2023-11-10 23:41:30 +01:00
'';
};
2023-11-10 23:35:26 +01:00
2023-11-10 23:41:30 +01:00
sessionPath = [ "$HOME/.cargo/bin" ];
};
2023-11-10 23:35:26 +01:00
};
}