diff --git a/lib/modules/windows.nix b/lib/modules/windows.nix index 29ee7245..da53d15e 100644 --- a/lib/modules/windows.nix +++ b/lib/modules/windows.nix @@ -1,4 +1,4 @@ -{ lib, config, ... }: +{ lib, config, options, ... }: let inherit (lib) mkOption @@ -7,7 +7,16 @@ types ; - setupUser = lib.strings.stringToCharacters config.valhalla.setupUser.name; + users = config.valhalla.users; + setupUser = config.valhalla.setupUser.name; + + capitalize = text: + let + chars = lib.strings.stringToCharacters text; + in lib.strings.concatStrings ( + [(lib.strings.toUpper (builtins.elemAt chars 0))] ++ + (lib.lists.drop 1 chars) + ); winType = types.submodule ( { config, ... }: { @@ -15,10 +24,16 @@ setupUser = mkOption { type = types.str; description = "The name of the user for setting up Windows."; - default = lib.strings.concatStrings ( - [(lib.strings.toUpper (builtins.elemAt setupUser 0))] ++ - (lib.lists.drop 1 setupUser) - ); + default = capitalize setupUser; + }; + + users = mkOption { + type = options.valhalla.users.type; + description = "The users to add."; + default = lib.attrsets.concatMapAttrs ( + name: options: { + ${capitalize name} = options; + }) users; }; dualboot = {