mkSuites: generalize for one profile/suite pair

This commit is contained in:
Pacman99 2021-04-26 10:52:26 -07:00
parent 59383e871f
commit ba01aa7db7

View File

@ -1,20 +1,20 @@
{ lib }: { lib }:
{ users, profiles, userProfiles, suites } @ args: { suites, profiles } @ args:
let let
inherit (lib) os; inherit (lib) os;
definedSuites = suites { profileSet = lib.genAttrs' profiles (path: {
inherit (args) users profiles userProfiles; name = baseNameOf path;
}; value = os.mkProfileAttrs (toString path);
});
allProfiles = lib.collectProfiles profiles; definedSuites = suites profileSet;
allUsers = lib.collectProfiles users;
createSuites = _: suites: lib.mapAttrs (_: v: os.profileMap v) suites // {
inherit allProfiles allUsers;
};
allProfiles = lib.collectProfiles profileSet;
in in
lib.mapAttrs createSuites definedSuites lib.mapAttrs (_: v: os.profileMap v) definedSuites // {
inherit allProfiles;
}