Clean up the users.nix file

This commit is contained in:
Manuel Thalmann 2024-08-23 18:51:54 +02:00
parent a12a8323d3
commit a2f47497de

View file

@ -7,11 +7,8 @@
cfg = config.valhalla; cfg = config.valhalla;
capitalize = (import ../text.nix { inherit lib; }).capitalize; capitalize = (import ../text.nix { inherit lib; }).capitalize;
in {
options = { userType = types.submodule (
valhalla = {
users = mkOption {
type = types.attrsOf (types.submodule (
{ ... } : { { ... } : {
options = { options = {
displayName = mkOption { displayName = mkOption {
@ -32,13 +29,10 @@
default = []; default = [];
}; };
}; };
})); });
description = "The users to create on the machine.";
default = {};
};
linux.users = mkOption { linuxUserType = types.submodule (
type = types.attrsOf (types.submodule { { ... }: {
options = { options = {
defaultShell = mkOption { defaultShell = mkOption {
type = types.nullOr types.str; type = types.nullOr types.str;
@ -47,10 +41,9 @@
}; };
}; };
}); });
};
windows.users = mkOption { winUserType = types.submodule (
type = types.attrsOf (types.submodule { { ... }: {
options = { options = {
microsoftAccount = mkOption { microsoftAccount = mkOption {
type = types.bool; type = types.bool;
@ -59,6 +52,21 @@
}; };
}; };
}); });
in {
options = {
valhalla = {
users = mkOption {
type = types.attrsOf userType;
description = "The users to create on the machine.";
default = {};
};
linux.users = mkOption {
type = types.attrsOf linuxUserType;
};
windows.users = mkOption {
type = types.attrsOf winUserType;
}; };
}; };
}; };