2025-01-06 14:41:55 -05:00
|
|
|
{
|
|
|
|
foldl,
|
|
|
|
hasAttr,
|
|
|
|
isAttrs,
|
|
|
|
isList,
|
|
|
|
mergeAttrsWithFunc,
|
|
|
|
unique,
|
|
|
|
...
|
|
|
|
}: {
|
|
|
|
inherit (import ../../inputs/lib.nix) recursiveUpdateList;
|
2024-12-29 05:40:30 -05:00
|
|
|
|
2025-01-06 14:41:55 -05:00
|
|
|
throws = x: !(builtins.tryEval x).success;
|
2024-12-29 05:40:30 -05:00
|
|
|
hasVersion = x: isAttrs x && hasAttr "version" x;
|
2025-01-06 14:41:55 -05:00
|
|
|
mergeAttrsList = list:
|
|
|
|
foldl (mergeAttrsWithFunc (a: b:
|
|
|
|
if isList a && isList b
|
|
|
|
then unique (a ++ b)
|
|
|
|
else b)) {}
|
|
|
|
list;
|
2024-12-16 15:51:41 -05:00
|
|
|
}
|