mirror of
https://github.com/nix-community/dream2nix.git
synced 2025-01-03 20:06:15 +03:00
overrides: allow passing functions for attributes
This commit is contained in:
parent
a0466031c0
commit
1219a10592
@ -52,7 +52,19 @@ let
|
||||
(lib.filterAttrs (n: v: lib.hasPrefix "override" n) condOverride);
|
||||
in
|
||||
b.foldl'
|
||||
(pkg: overrideFunc: pkg."${overrideFunc.funcName}" overrideFunc.func)
|
||||
(pkg: overrideFunc:
|
||||
pkg."${overrideFunc.funcName}"
|
||||
(old:
|
||||
let
|
||||
updateAttrsFuncs = overrideFunc.func old;
|
||||
in
|
||||
lib.mapAttrs
|
||||
(attrName: maybeFunction:
|
||||
if b.isFunction maybeFunction then
|
||||
maybeFunction old."${attrName}"
|
||||
else
|
||||
maybeFunction)
|
||||
updateAttrsFuncs))
|
||||
pkg
|
||||
overrideFuncs;
|
||||
in
|
||||
|
Loading…
Reference in New Issue
Block a user