mirror of
https://github.com/nickolaj-jepsen/nixos.git
synced 2026-01-22 00:01:58 +01:00
17 lines
393 B
Nix
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;
|
|
}
|