users-groups module: optionSet -> submodule

This commit is contained in:
Eric Sagnes 2016-09-11 16:35:50 +09:00
parent 25a7ded89c
commit 77f572f072

View File

@ -131,13 +131,12 @@ let
}; };
subUidRanges = mkOption { subUidRanges = mkOption {
type = types.listOf types.optionSet; type = with types; listOf (submodule subordinateUidRange);
default = []; default = [];
example = [ example = [
{ startUid = 1000; count = 1; } { startUid = 1000; count = 1; }
{ startUid = 100001; count = 65534; } { startUid = 100001; count = 65534; }
]; ];
options = [ subordinateUidRange ];
description = '' description = ''
Subordinate user ids that user is allowed to use. Subordinate user ids that user is allowed to use.
They are set into <filename>/etc/subuid</filename> and are used They are set into <filename>/etc/subuid</filename> and are used
@ -146,13 +145,12 @@ let
}; };
subGidRanges = mkOption { subGidRanges = mkOption {
type = types.listOf types.optionSet; type = with types; listOf (submodule subordinateGidRange);
default = []; default = [];
example = [ example = [
{ startGid = 100; count = 1; } { startGid = 100; count = 1; }
{ startGid = 1001; count = 999; } { startGid = 1001; count = 999; }
]; ];
options = [ subordinateGidRange ];
description = '' description = ''
Subordinate group ids that user is allowed to use. Subordinate group ids that user is allowed to use.
They are set into <filename>/etc/subgid</filename> and are used They are set into <filename>/etc/subgid</filename> and are used
@ -310,32 +308,36 @@ let
}; };
subordinateUidRange = { subordinateUidRange = {
startUid = mkOption { options = {
type = types.int; startUid = mkOption {
description = '' type = types.int;
Start of the range of subordinate user ids that user is description = ''
allowed to use. Start of the range of subordinate user ids that user is
''; allowed to use.
}; '';
count = mkOption { };
type = types.int; count = mkOption {
default = 1; type = types.int;
description = ''Count of subordinate user ids''; default = 1;
description = ''Count of subordinate user ids'';
};
}; };
}; };
subordinateGidRange = { subordinateGidRange = {
startGid = mkOption { options = {
type = types.int; startGid = mkOption {
description = '' type = types.int;
Start of the range of subordinate group ids that user is description = ''
allowed to use. Start of the range of subordinate group ids that user is
''; allowed to use.
}; '';
count = mkOption { };
type = types.int; count = mkOption {
default = 1; type = types.int;
description = ''Count of subordinate group ids''; default = 1;
description = ''Count of subordinate group ids'';
};
}; };
}; };
@ -428,7 +430,7 @@ in {
users.users = mkOption { users.users = mkOption {
default = {}; default = {};
type = types.loaOf types.optionSet; type = with types; loaOf (submodule userOpts);
example = { example = {
alice = { alice = {
uid = 1234; uid = 1234;
@ -444,7 +446,6 @@ in {
Additional user accounts to be created automatically by the system. Additional user accounts to be created automatically by the system.
This can also be used to set options for root. This can also be used to set options for root.
''; '';
options = [ userOpts ];
}; };
users.groups = mkOption { users.groups = mkOption {
@ -453,11 +454,10 @@ in {
{ students.gid = 1001; { students.gid = 1001;
hackers = { }; hackers = { };
}; };
type = types.loaOf types.optionSet; type = with types; loaOf (submodule groupOpts);
description = '' description = ''
Additional groups to be created automatically by the system. Additional groups to be created automatically by the system.
''; '';
options = [ groupOpts ];
}; };
# FIXME: obsolete - will remove. # FIXME: obsolete - will remove.