better type for config.groups

instead of an attrset of anything, specify the expected
structure of each value
module-based-network
Daniel Barlow 2023-02-25 20:33:18 +00:00
parent 228b270385
commit 690cedf00d
1 changed files with 15 additions and 3 deletions

View File

@ -36,7 +36,17 @@ in {
};
};
groups = mkOption {
type = types.attrsOf types.anything;
type = types.attrsOf (types.submodule {
options = {
gid = mkOption {
type = types.int;
};
usernames = mkOption {
type = types.listOf types.str;
default = [];
};
};
});
};
users = mkOption {
type = types.attrsOf types.anything;
@ -107,8 +117,10 @@ in {
passwd = "";
shell = "/bin/sh";
};
groups.root = {
gid = 0; usernames = ["root"];
groups = {
root = {
gid = 0; usernames = ["root"];
};
};
filesystem = dir {