From 690cedf00d7ad4610deaa79d1f6f36bc19123a30 Mon Sep 17 00:00:00 2001 From: Daniel Barlow Date: Sat, 25 Feb 2023 20:33:18 +0000 Subject: [PATCH] better type for config.groups instead of an attrset of anything, specify the expected structure of each value --- modules/base.nix | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/modules/base.nix b/modules/base.nix index af1e233..377adca 100644 --- a/modules/base.nix +++ b/modules/base.nix @@ -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 {