mirror of
https://github.com/aviallon/nixos-lib.git
synced 2026-04-06 09:47:52 +00:00
17 lines
377 B
Nix
17 lines
377 B
Nix
{lib, myLib, ...}:
|
|
with lib;
|
|
rec {
|
|
mergeAttrsRecursive = a: b: foldAttrs (item: acc:
|
|
if (isNull acc) then
|
|
item
|
|
else if (isList item) then
|
|
if isList acc then
|
|
acc ++ item
|
|
else [ acc ] ++ item
|
|
else if (isString item) then
|
|
acc + item
|
|
else if (isAttrs item) then
|
|
mergeAttrsRecursive acc item
|
|
else item
|
|
) null [ b a ];
|
|
}
|