nixos/lib/util.nix

18 lines
393 B
Nix
Raw Normal View History

2025-02-03 07:55:17 +01:00
{lib, ...}:
with lib; {
recursiveMerge = attrList: let
f = attrPath:
zipAttrsWith (
n: values:
if tail values == []
then head values
else if all isList values
then unique (concatLists values)
else if all isAttrs values
then f (attrPath ++ [n]) values
else last values
);
in
f [] attrList;
}