add sccache

This commit is contained in:
Vivian 2023-11-10 23:35:26 +01:00
parent 187bc9261e
commit 2713f04a9e
3 changed files with 23 additions and 2 deletions

View file

@ -1,3 +1,3 @@
{ ... }: {
imports = [ ./catppuccin.nix ./nvim.nix ./riff.nix ./vscode.nix ./git.nix ];
imports = [ ./catppuccin.nix ./nvim.nix ./riff.nix ./vscode.nix ./git.nix ./rust.nix ];
}

View file

@ -0,0 +1,21 @@
{ 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" ];
};
}