mirror of
https://github.com/aviallon/nixos-lib.git
synced 2026-04-05 17:27:50 +00:00
[Optimizations] Enable lto by default + recursively optimize one level if needed
This commit is contained in:
parent
d3e80fda86
commit
2a7d942702
1 changed files with 8 additions and 1 deletions
|
|
@ -14,6 +14,9 @@ let
|
||||||
extraCFlags ? cfg.extraCompileFlags,
|
extraCFlags ? cfg.extraCompileFlags,
|
||||||
blacklist ? cfg.blacklist,
|
blacklist ? cfg.blacklist,
|
||||||
overrideMap ? cfg.overrideMap,
|
overrideMap ? cfg.overrideMap,
|
||||||
|
recursive ? 1,
|
||||||
|
level ? "slower",
|
||||||
|
lto ? cfg.lto,
|
||||||
...
|
...
|
||||||
}@attrs: pkg:
|
}@attrs: pkg:
|
||||||
myLib.optimizations.optimizePkg pkg ({
|
myLib.optimizations.optimizePkg pkg ({
|
||||||
|
|
@ -27,7 +30,11 @@ in {
|
||||||
description = "Enable aviallon's optimizations";
|
description = "Enable aviallon's optimizations";
|
||||||
type = types.bool;
|
type = types.bool;
|
||||||
};
|
};
|
||||||
lto = mkEnableOption "enable LTO for some packages";
|
lto = mkOption {
|
||||||
|
description = "Wether to enable LTO for some packages";
|
||||||
|
type = types.bool;
|
||||||
|
default = true;
|
||||||
|
};
|
||||||
extraCompileFlags = mkOption {
|
extraCompileFlags = mkOption {
|
||||||
default = [ "-mtune=${generalCfg.cpuTune}" ];
|
default = [ "-mtune=${generalCfg.cpuTune}" ];
|
||||||
example = [ "-O2" "-mavx" ];
|
example = [ "-O2" "-mavx" ];
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue