mirror of
https://github.com/XNM1/linux-nixos-hyprland-config-dotfiles.git
synced 2025-09-15 09:45:58 +03:00

Changelog: - Applied fixes for system apps with the latest `nixpkgs` update. - Updated `wezterm` to the latest Git version and refreshed its configuration. - Optimized Rust Cargo template. - Added several new Language Server Protocols (LSPs). - Introduced new Rust targets to the environment. - Added `pwgen`, `pwgen-secure`, and `git-secrets` packages. - Added `gcc`, `clang`, `lld`, `lldb`, and `musl` packages for compiling and debugging.
34 lines
1.6 KiB
TOML
34 lines
1.6 KiB
TOML
### Cargo code snippets for different optimizations
|
|
|
|
## Dev build compilation speed optimization (more https://benw.is/posts/how-i-improved-my-rust-compile-times-by-seventy-five-percent)
|
|
# Work only with the nightly version of Rust by the time it was written; it is recommended NOT to use it in production for now
|
|
cargo-features = [ "codegen-backend", "profile-rustflags" ]
|
|
# Important: It provides less useful error messages during compilation
|
|
[profile.dev]
|
|
opt-level = 1
|
|
codegen-backend = "cranelift"
|
|
rustflags = [
|
|
"-Z", "threads=8", # Enable parallel frontend compiling
|
|
"-C", "linker=clang", # Use clang as the linker
|
|
"-C", "link-arg=-fuse-ld=mold", # Use mold as the linker backend
|
|
"-C", "link-arg=-static",
|
|
]
|
|
[profile.dev.package."*"]
|
|
opt-level = 3
|
|
codegen-backend = "cranelift"
|
|
|
|
[profile.dev.build-override]
|
|
rustflags = [ "-Z", "threads=8", "-C", "link-arg=-fuse-ld=/run/current-system/sw/bin/mold" ] # `/run/current-system/sw/bin/mold` is an absolute path to the mold executable
|
|
|
|
## Release build size optimization (more https://github.com/johnthagen/min-sized-rust)
|
|
# You can also use programs such as `upx` for size optimization
|
|
[profile.release]
|
|
strip = true
|
|
opt-level = "z" # You can try 's' instead of 'z' if you want to optimize for speed
|
|
lto = true
|
|
codegen-units = 1
|
|
panic = "abort" # DELETE extra unwinding code that provides helpful backtrace information for runtime errors
|
|
|
|
[profile.release.build-override]
|
|
rustflags = [ "-Z", "location-detail=none" ] # DELETE a useful traceback information such as file, line, and column information for panic!() and [track_caller]
|