mirror of
https://github.com/aviallon/nixos-lib.git
synced 2026-04-05 17:27:50 +00:00
[Optimizations] Add ability to specify additional attributes to package override
This commit is contained in:
parent
38e8749e77
commit
3e472dff54
2 changed files with 6 additions and 2 deletions
|
|
@ -215,6 +215,7 @@ rec {
|
|||
, overrideMap ? { }
|
||||
, stdenv ? null
|
||||
, lto ? false
|
||||
, attributes ? { }
|
||||
, _depth ? 0
|
||||
, ...
|
||||
}@attrs:
|
||||
|
|
@ -289,8 +290,10 @@ rec {
|
|||
CFLAGS = if (! isList old.CFLAGS) then [ old.CFLAGS ] else old.CFLAGS;
|
||||
}
|
||||
);
|
||||
_pkgOptimized = addAttrs _pkg optimizedAttrs;
|
||||
_pkgFinal = addAttrs _pkgOptimized attributes;
|
||||
in
|
||||
trace "Optimized ${myGetName pkg} with overrideAttrs at level '${level}' (depth: ${toString _depth}, lto: ${toString lto})" (addAttrs _pkg optimizedAttrs)
|
||||
trace "Optimized ${myGetName pkg} with overrideAttrs at level '${level}' (depth: ${toString _depth}, lto: '${toString lto}')" _pkgFinal
|
||||
else if (hasAttr "name" pkg) then
|
||||
warn "Can't optimize ${myGetName pkg} (depth: ${toString _depth})" pkg
|
||||
else
|
||||
|
|
|
|||
|
|
@ -16,11 +16,12 @@ let
|
|||
ltoBlacklist ? cfg.lto.blacklist,
|
||||
overrideMap ? cfg.overrideMap,
|
||||
lto ? cfg.lto,
|
||||
attributes ? {},
|
||||
stdenv ? null,
|
||||
...
|
||||
}@attrs: pkg:
|
||||
myLib.optimizations.optimizePkg pkg (cfg.defaultSettings // {
|
||||
inherit cpuCores cpuTune cpuArch extraCFlags blacklist ltoBlacklist overrideMap stdenv;
|
||||
inherit cpuCores cpuTune cpuArch extraCFlags blacklist ltoBlacklist overrideMap stdenv attributes;
|
||||
} // attrs);
|
||||
in {
|
||||
options.aviallon.optimizations = {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue