Skip to content

Commit

Permalink
add rust config
Browse files Browse the repository at this point in the history
  • Loading branch information
uku3lig committed Jan 5, 2024
1 parent a3d7290 commit 5e5a152
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions programs/rust.nix
Original file line number Diff line number Diff line change
@@ -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}"];
};
};
}

0 comments on commit 5e5a152

Please sign in to comment.