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