Remove unnecessary options from Win users
This commit is contained in:
parent
b28a38b191
commit
db38cf2207
2 changed files with 29 additions and 18 deletions
|
@ -8,6 +8,22 @@
|
|||
cfg = config.valhalla;
|
||||
capitalize = (import ../text.nix { inherit lib; }).capitalize;
|
||||
|
||||
linuxOptions = {
|
||||
defaultShell = mkOption {
|
||||
type = types.nullOr types.str;
|
||||
description = "The default shell of the user.";
|
||||
default = null;
|
||||
};
|
||||
|
||||
rclone = {
|
||||
configurations = mkOption {
|
||||
type = types.attrsOf syncType;
|
||||
description = "The configurations of the rclone mounts.";
|
||||
default = {};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
syncType = types.submodule (
|
||||
{ ... }: {
|
||||
options = {
|
||||
|
@ -46,25 +62,13 @@
|
|||
default = [];
|
||||
};
|
||||
|
||||
defaultShell = mkOption {
|
||||
type = types.nullOr types.str;
|
||||
description = "The default shell of the user.";
|
||||
default = null;
|
||||
};
|
||||
|
||||
rclone = {
|
||||
configurations = mkOption {
|
||||
type = types.attrsOf syncType;
|
||||
description = "The configurations of the rclone mounts.";
|
||||
default = {};
|
||||
};
|
||||
};
|
||||
|
||||
git = (import ./git/options.nix) { inherit lib; };
|
||||
} // options;
|
||||
}));
|
||||
|
||||
userType = mkUserType { options = {}; };
|
||||
userType = mkUserType {
|
||||
options = linuxOptions;
|
||||
};
|
||||
|
||||
winUserType = mkUserType {
|
||||
options = {
|
||||
|
@ -88,7 +92,10 @@
|
|||
type = types.attrsOf winUserType;
|
||||
description = "The users to create on the Windows machine.";
|
||||
default = lib.attrsets.concatMapAttrs (
|
||||
name: options: {
|
||||
name: options:
|
||||
if builtins.elem name (builtins.attrNames linuxOptions)
|
||||
then {}
|
||||
else {
|
||||
${capitalize name} = options;
|
||||
}) cfg.users;
|
||||
};
|
||||
|
|
|
@ -10,6 +10,10 @@
|
|||
enable = true;
|
||||
linuxPercentage = 70; # better safe than sorry
|
||||
};
|
||||
|
||||
users.Manuel = {
|
||||
microsoftAccount = true;
|
||||
};
|
||||
};
|
||||
|
||||
partition.os.partitions = {
|
||||
|
|
Loading…
Reference in a new issue