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 {
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 {