From 5cfdec6e94574e8e08068e2de5e8ef2a375bb894 Mon Sep 17 00:00:00 2001 From: Silvan Mosberger Date: Fri, 7 Sep 2018 20:59:12 +0200 Subject: [PATCH] lib: Improve overrideExisting implementation --- lib/attrsets.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/attrsets.nix b/lib/attrsets.nix index 1e4142562fa..9bac69af34f 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.