2021-04-18 02:29:45 +00:00
|
|
|
{ lib }:
|
2021-03-14 07:10:51 +00:00
|
|
|
{
|
2021-04-26 03:53:16 +00:00
|
|
|
collectProfiles = set:
|
|
|
|
let
|
|
|
|
collectNestedProfiles = set:
|
2021-05-02 00:49:04 +00:00
|
|
|
lib.mapAttrsToList
|
|
|
|
(n: v:
|
|
|
|
if builtins.isAttrs v then
|
|
|
|
[ v.default or null ] ++ collectNestedProfiles v
|
|
|
|
else null
|
|
|
|
)
|
|
|
|
set;
|
2021-04-26 03:53:16 +00:00
|
|
|
in
|
2021-05-02 00:49:04 +00:00
|
|
|
builtins.filter (x: x != null) (lib.flatten (collectNestedProfiles set));
|
2021-04-26 03:53:16 +00:00
|
|
|
|
2021-05-02 00:49:04 +00:00
|
|
|
profileMap = list: map (profile: profile.default) (lib.flatten list);
|
2021-04-25 23:46:02 +00:00
|
|
|
|
|
|
|
unifyOverlays = channels: map (o: if builtins.isFunction (o null null) then o channels else o);
|
2021-03-14 07:10:51 +00:00
|
|
|
}
|