Clean up the users.nix file

This commit is contained in:
Manuel Thalmann 2024-08-23 18:51:54 +02:00
parent 6ae1a4a688
commit c2b83d666a

View file

@ -7,12 +7,9 @@
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 {
type = types.nullOr types.str; type = types.nullOr types.str;
@ -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;
}; };
}; };
}; };