lib: Improve overrideExisting implementation

This commit is contained in:
Silvan Mosberger 2018-09-07 20:59:12 +02:00
parent af8125c46f
commit 5cfdec6e94
No known key found for this signature in database
GPG Key ID: 9424360B4B85C9E7
1 changed files with 1 additions and 1 deletions

View File

@ -440,7 +440,7 @@ rec {
=> { a = { b = 6; d = 2; }; } => { a = { b = 6; d = 2; }; }
*/ */
overrideExisting = old: new: overrideExisting = old: new:
old // listToAttrs (map (attr: nameValuePair attr (attrByPath [attr] old.${attr} new)) (attrNames old)); mapAttrs (name: value: new.${name} or value) old;
/* Get a package output. /* Get a package output.
If no output is found, fallback to `.out` and then to the default. If no output is found, fallback to `.out` and then to the default.