infrastructure/nixos/common/hm-modules/rust.nix
Vivian ec0c2f466a
Some checks failed
Plex Update / update (push) Successful in 1m30s
Lint / lint (push) Failing after 1m15s
add sccache
2023-11-10 23:35:26 +01:00

22 lines
472 B
Nix

{ pkgs, lib, config, ... }:
with lib;
let cfg = config.programs.v.rust;
in {
options.programs.v.rust = { enable = mkEnableOption "rust"; };
config = mkIf cfg.enable {
home.packages = with pkgs; [ rustup ];
home.file = {
".cargo/config.toml".text = ''
[registries.crates-io]
protocol = "sparse"
[build]
rustc-wrapper = "${pkgs.sccache}/bin/sccache"
'';
};
home.sessionPath = [ "$HOME/.cargo/bin" ];
};
}