diff options
author | Silvan Mosberger <infinisil@icloud.com> | 2018-09-07 20:59:12 +0200 |
---|---|---|
committer | Silvan Mosberger <infinisil@icloud.com> | 2018-09-07 21:00:14 +0200 |
commit | 5cfdec6e94574e8e08068e2de5e8ef2a375bb894 (patch) | |
tree | b24e1e86ad0a5f4f00a4145b2aa7ab46c22b6b9e /lib/attrsets.nix | |
parent | af8125c46f51ea0c15e50c994216ed1c428ba7bf (diff) |
lib: Improve overrideExisting implementation
Diffstat (limited to 'lib/attrsets.nix')
-rw-r--r-- | lib/attrsets.nix | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/attrsets.nix b/lib/attrsets.nix index 1e4142562fa69..9bac69af34f37 100644 --- a/lib/attrsets.nix +++ b/lib/attrsets.nix @@ -440,7 +440,7 @@ rec { => { a = { b = 6; d = 2; }; } */ 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. If no output is found, fallback to `.out` and then to the default. |