Add multi-user support for various applications and services
Enhanced the configuration files to support multi-user management by introducing user options for multiple applications, including art, gaming, multimedia, and development tools. Updated existing modules to utilize these new user options, improving flexibility and maintainability in user package installations.
This commit is contained in:
@@ -6,19 +6,26 @@
|
||||
...
|
||||
}:
|
||||
{
|
||||
options.my.shell.type = lib.mkOption {
|
||||
type = lib.types.enum [
|
||||
"bash"
|
||||
"zsh"
|
||||
];
|
||||
default = "bash";
|
||||
description = "The shell to use system-wide (bash or zsh)";
|
||||
options.my.shell = {
|
||||
type = lib.mkOption {
|
||||
type = lib.types.enum [
|
||||
"bash"
|
||||
"zsh"
|
||||
];
|
||||
default = "bash";
|
||||
description = "The shell to use system-wide (bash or zsh)";
|
||||
};
|
||||
users = lib.mkOption {
|
||||
type = lib.types.either lib.types.str (lib.types.listOf lib.types.str);
|
||||
default = config.my.toggleUsers.shell;
|
||||
description = "Users to configure shell for";
|
||||
};
|
||||
};
|
||||
config = {
|
||||
users.users = lib.mkMerge (
|
||||
map (user: {
|
||||
${user}.shell = pkgs.${config.my.shell.type};
|
||||
}) (inputs.self.lib.normalizeUsers config.my.toggleUsers.shell)
|
||||
}) (inputs.self.lib.normalizeUsers config.my.shell.users)
|
||||
);
|
||||
programs.zsh.enable = config.my.shell.type == "zsh";
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user