forked from pub-solar/os
mkSuites: generalize for one profile/suite pair
This commit is contained in:
parent
59383e871f
commit
ba01aa7db7
|
@ -1,20 +1,20 @@
|
|||
{ lib }:
|
||||
|
||||
{ users, profiles, userProfiles, suites } @ args:
|
||||
{ suites, profiles } @ args:
|
||||
let
|
||||
inherit (lib) os;
|
||||
|
||||
definedSuites = suites {
|
||||
inherit (args) users profiles userProfiles;
|
||||
};
|
||||
profileSet = lib.genAttrs' profiles (path: {
|
||||
name = baseNameOf path;
|
||||
value = os.mkProfileAttrs (toString path);
|
||||
});
|
||||
|
||||
allProfiles = lib.collectProfiles profiles;
|
||||
|
||||
allUsers = lib.collectProfiles users;
|
||||
|
||||
createSuites = _: suites: lib.mapAttrs (_: v: os.profileMap v) suites // {
|
||||
inherit allProfiles allUsers;
|
||||
};
|
||||
definedSuites = suites profileSet;
|
||||
|
||||
allProfiles = lib.collectProfiles profileSet;
|
||||
in
|
||||
lib.mapAttrs createSuites definedSuites
|
||||
lib.mapAttrs (_: v: os.profileMap v) definedSuites // {
|
||||
inherit allProfiles;
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue