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:
|
|
|
|
lib.mapAttrsToList (n: v:
|
|
|
|
if builtins.isAttrs v then
|
|
|
|
[ v.default or null ] ++ collectNestedProfiles v
|
|
|
|
else null
|
|
|
|
) set;
|
|
|
|
in
|
|
|
|
builtins.filter (x: x != null) (lib.flatten (collectNestedProfiles set));
|
|
|
|
|
2021-03-14 08:10:51 +01:00
|
|
|
pathsIn = dir:
|
|
|
|
let
|
2021-04-09 05:17:24 +02:00
|
|
|
fullPath = name: "${toString dir}/${name}";
|
2021-03-14 08:10:51 +01:00
|
|
|
in
|
2021-04-18 03:35:05 +02:00
|
|
|
map fullPath (lib.attrNames (lib.safeReadDir dir));
|
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
|
|
|
}
|