cargo optimizations
This commit is contained in:
parent
5bd748f506
commit
435ceb1189
2 changed files with 39 additions and 29 deletions
38
users/tao/cargo.nix
Normal file
38
users/tao/cargo.nix
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
{ pkgs, ... }: {
|
||||
home.file.".cargo/config.toml".text = ''
|
||||
[alias]
|
||||
rr = "run --release"
|
||||
|
||||
[build]
|
||||
target = "x86_64-unknown-linux-musl"
|
||||
rustc-wrapper = "${pkgs.sccache}/bin/sccache"
|
||||
rustflags = ["-Z", "threads=8"]
|
||||
|
||||
[unstable]
|
||||
codegen-backend = true
|
||||
|
||||
[provile.dev]
|
||||
debug = 0
|
||||
strip = "debuginfo"
|
||||
opt-level = 1
|
||||
lto = "off"
|
||||
codegen-backend = "cranelift"
|
||||
|
||||
[profile.dev.package."*"]
|
||||
# slow clean build for faster incrementals
|
||||
opt-level = 3
|
||||
|
||||
[profile.release]
|
||||
incremental = true
|
||||
codegen-units = 1
|
||||
lto = "fat"
|
||||
|
||||
[target.x86-unknown-linux-musl]
|
||||
# linker = "musl-gcc"
|
||||
linker = "clang"
|
||||
rustflag = ["-C", "target-cpu=native", "link-arg=ld-path=${pkgs.mold}/bin/mold"]
|
||||
|
||||
# https://benw.is/posts/how-i-improved-my-rust-compile-times-by-seventy-five-percent
|
||||
# jonhoo
|
||||
'';
|
||||
}
|
||||
|
|
@ -2,9 +2,9 @@
|
|||
imports = [
|
||||
(import ./helix.nix { inherit pkgs inputs; })
|
||||
# ./hyprland.nix
|
||||
./cargo.nix
|
||||
];
|
||||
|
||||
|
||||
programs = {
|
||||
jujutsu = {
|
||||
enable = true;
|
||||
|
|
@ -54,34 +54,6 @@
|
|||
};
|
||||
};
|
||||
|
||||
home.file.".cargo/config.toml".text = ''
|
||||
[alias]
|
||||
rr = "run --release"
|
||||
|
||||
[build]
|
||||
target = "x86_64-unknown-linux-musl"
|
||||
rustc-wrapper = "${pkgs.sccache}/bin/sccache"
|
||||
|
||||
[unstable]
|
||||
codegen-backend = true
|
||||
|
||||
[provile.dev]
|
||||
debug = 0
|
||||
strip = "debuginfo"
|
||||
lto = "off"
|
||||
codegen-backend = "cranelift"
|
||||
|
||||
[profile.release]
|
||||
incremental = true
|
||||
codegen-units = 1
|
||||
lto = "fat"
|
||||
|
||||
[target.x86-unknown-linux-musl]
|
||||
# linker = "musl-gcc"
|
||||
# linker = "clang"
|
||||
rustflag = ["-C", "target-cpu=native", "link-arg=ld-path=${pkgs.mold}/bin/mold"]
|
||||
'';
|
||||
|
||||
home.username = "tao";
|
||||
home.homeDirectory = "/home/tao";
|
||||
home.stateVersion = "23.11";
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue