add rust config
This commit is contained in:
parent
a3d7290a15
commit
5e5a152304
1 changed files with 20 additions and 0 deletions
20
programs/rust.nix
Normal file
20
programs/rust.nix
Normal file
|
@ -0,0 +1,20 @@
|
|||
{
|
||||
lib,
|
||||
pkgs,
|
||||
config,
|
||||
...
|
||||
}: let
|
||||
toml = pkgs.formats.toml {};
|
||||
in {
|
||||
hm.home.file.".cargo/config.toml".source = toml.generate "config.toml" {
|
||||
build = {
|
||||
rustc-wrapper = "${lib.getExe' pkgs.sccache "sccache"}";
|
||||
target-dir = "${config.hm.home.homeDirectory}/.cargo/target";
|
||||
};
|
||||
|
||||
target.x86_64-unknown-linux-gnu = {
|
||||
linker = "${lib.getExe pkgs.clang}";
|
||||
rustflags = ["-C" "link-arg=-fuse-ld=${lib.getExe pkgs.mold}"];
|
||||
};
|
||||
};
|
||||
}
|
Loading…
Reference in a new issue