os/lib/recursive-merge.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

15 lines
328 B
Nix
Raw Normal View History

2024-08-18 22:22:59 +00:00
{lib}: 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
2024-08-18 22:22:59 +00:00
f [] attrList