2021-04-18 05:29:45 +03:00
|
|
|
{ lib }:
|
2021-03-14 10:10:51 +03:00
|
|
|
{
|
2021-04-26 06:53:16 +03: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 10:10:51 +03:00
|
|
|
pathsIn = dir:
|
|
|
|
let
|
2021-04-09 06:17:24 +03:00
|
|
|
fullPath = name: "${toString dir}/${name}";
|
2021-03-14 10:10:51 +03:00
|
|
|
in
|
2021-04-18 04:35:05 +03:00
|
|
|
map fullPath (lib.attrNames (lib.safeReadDir dir));
|
2021-04-26 02:46:02 +03:00
|
|
|
|
|
|
|
unifyOverlays = channels: map (o: if builtins.isFunction (o null null) then o channels else o);
|
2021-03-14 10:10:51 +03:00
|
|
|
}
|