nrr: enable LTO by default

This commit is contained in:
Ryan Cao 2024-08-14 17:22:02 +08:00
parent 370ecf3c9d
commit a186a7c2c5
No known key found for this signature in database
GPG Key ID: 48C96B2057D71CB1

View File

@ -5,12 +5,14 @@
, darwin
, pkg-config
, libiconv
, enableLTO ? true
, nrxAlias ? true
}:
rustPlatform.buildRustPackage rec {
pname = "nrr";
version = "0.9.4";
__structuredAttrs = true;
src = fetchFromGitHub {
owner = "ryanccn";
@ -32,6 +34,11 @@ rustPlatform.buildRustPackage rec {
pkg-config
];
env = lib.optionalAttrs enableLTO {
CARGO_PROFILE_RELEASE_LTO = "fat";
CARGO_PROFILE_RELEASE_CODEGEN_UNITS = "1";
};
postInstall = lib.optionalString nrxAlias "ln -s $out/bin/nr{r,x}";
meta = with lib; {