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:
|
|
|
|
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 07:10:51 +00:00
|
|
|
pathsIn = dir:
|
|
|
|
let
|
2021-04-09 03:17:24 +00:00
|
|
|
fullPath = name: "${toString dir}/${name}";
|
2021-03-14 07:10:51 +00:00
|
|
|
in
|
2021-04-18 01:35:05 +00:00
|
|
|
map fullPath (lib.attrNames (lib.safeReadDir dir));
|
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
|
|
|
}
|