mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-02-07 12:44:20 +00:00
linkFarm: make last entry win in case of list repeats
This commit is contained in:
parent
ea5dd5d6af
commit
6382598677
@ -489,7 +489,8 @@ rec {
|
|||||||
let
|
let
|
||||||
entries' =
|
entries' =
|
||||||
if (lib.isAttrs entries) then entries
|
if (lib.isAttrs entries) then entries
|
||||||
else if (lib.isList entries) then lib.listToAttrs (map (x: lib.nameValuePair x.name x.path) entries)
|
# We do this foldl to have last-wins semantics in case of repeated entries
|
||||||
|
else if (lib.isList entries) then lib.foldl (a: b: a // { "${b.name}" = b.path; }) { } entries
|
||||||
else throw "linkFarm entries must be either attrs or a list!";
|
else throw "linkFarm entries must be either attrs or a list!";
|
||||||
|
|
||||||
linkCommands = lib.mapAttrsToList (name: path: ''
|
linkCommands = lib.mapAttrsToList (name: path: ''
|
||||||
|
Loading…
Reference in New Issue
Block a user