nrr: enable LTO by default

This commit is contained in:
Ryan Cao
2024-08-18 18:08:44 +08:00
parent 370ecf3c9d
commit a186a7c2c5
+7
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; {