nixos/lib/util.nix
2025-02-04 07:53:18 +01:00

17 lines
393 B
Nix

{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;
}