mkSuites: generalize for one profile/suite pair
This commit is contained in:
parent
59383e871f
commit
ba01aa7db7
@ -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;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user