better type for config.groups

instead of an attrset of anything, specify the expected
structure of each value
This commit is contained in:
Daniel Barlow 2023-02-25 20:33:18 +00:00
parent 228b270385
commit 690cedf00d

View file

@ -36,7 +36,17 @@ in {
}; };
}; };
groups = mkOption { 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 { users = mkOption {
type = types.attrsOf types.anything; type = types.attrsOf types.anything;
@ -107,8 +117,10 @@ in {
passwd = ""; passwd = "";
shell = "/bin/sh"; shell = "/bin/sh";
}; };
groups.root = { groups = {
gid = 0; usernames = ["root"]; root = {
gid = 0; usernames = ["root"];
};
}; };
filesystem = dir { filesystem = dir {