mirror of
https://github.com/aviallon/nixos-lib.git
synced 2026-04-06 01:38:06 +00:00
[Optimizations] fix long-before broken default value for "lto"
This commit is contained in:
parent
14c85b4e90
commit
6d934beacc
1 changed files with 23 additions and 15 deletions
|
|
@ -7,26 +7,34 @@ let
|
||||||
|
|
||||||
addAttrs = myLib.optimizations.addAttrs;
|
addAttrs = myLib.optimizations.addAttrs;
|
||||||
|
|
||||||
|
defaultOptimizeAttrs = {
|
||||||
|
level = "normal";
|
||||||
|
recursive = 0;
|
||||||
|
cpuCores = generalCfg.cpu.threads;
|
||||||
|
cpuArch = generalCfg.cpu.arch;
|
||||||
|
cpuTune = generalCfg.cpu.tune;
|
||||||
|
l1dCache = generalCfg.cpu.caches.l1d;
|
||||||
|
l1iCache = generalCfg.cpu.caches.l1i;
|
||||||
|
l1LineCache = generalCfg.cpu.caches.cacheLine;
|
||||||
|
lastLevelCache = generalCfg.cpu.caches.lastLevel;
|
||||||
|
extraCFlags = cfg.extraCompileFlags;
|
||||||
|
blacklist = cfg.blacklist;
|
||||||
|
ltoBlacklist = cfg.lto.blacklist;
|
||||||
|
overrideMap = cfg.overrideMap;
|
||||||
|
lto = cfg.lto.enable;
|
||||||
|
};
|
||||||
|
|
||||||
optimizePkg = {
|
optimizePkg = {
|
||||||
cpuCores ? generalCfg.cpu.threads,
|
|
||||||
cpuArch ? generalCfg.cpu.arch,
|
|
||||||
cpuTune ? generalCfg.cpu.tune,
|
|
||||||
l1dCache ? generalCfg.cpu.caches.l1d,
|
|
||||||
l1iCache ? generalCfg.cpu.caches.l1i,
|
|
||||||
l1LineCache ? generalCfg.cpu.caches.cacheLine,
|
|
||||||
lastLevelCache ? generalCfg.cpu.caches.lastLevel,
|
|
||||||
extraCFlags ? cfg.extraCompileFlags,
|
|
||||||
blacklist ? cfg.blacklist,
|
|
||||||
ltoBlacklist ? cfg.lto.blacklist,
|
|
||||||
overrideMap ? cfg.overrideMap,
|
|
||||||
lto ? cfg.lto,
|
|
||||||
attributes ? {},
|
attributes ? {},
|
||||||
stdenv ? null,
|
stdenv ? null,
|
||||||
...
|
...
|
||||||
}@attrs: pkg:
|
}@attrs: pkg:
|
||||||
myLib.optimizations.optimizePkg pkg (cfg.defaultSettings // {
|
myLib.optimizations.optimizePkg pkg (
|
||||||
inherit cpuCores cpuTune cpuArch extraCFlags blacklist ltoBlacklist overrideMap stdenv attributes l1dCache l1iCache l1LineCache lastLevelCache;
|
defaultOptimizeAttrs
|
||||||
} // attrs);
|
// cfg.defaultSettings
|
||||||
|
// { inherit stdenv attributes; }
|
||||||
|
// attrs
|
||||||
|
);
|
||||||
in {
|
in {
|
||||||
options.aviallon.optimizations = {
|
options.aviallon.optimizations = {
|
||||||
enable = mkOption {
|
enable = mkOption {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue