Files
NixOS/modules/shell/config.nix
Danilo Reyes f1e6015d39 Add multi-user support for package installations across various modules
Updated multiple configuration files to include a `merge` option for user management, enhancing the ability to handle multi-user setups for applications and services. This change improves flexibility in managing user-specific package installations, ensuring a more streamlined configuration process.
2026-01-16 13:38:49 -06:00

34 lines
781 B
Nix

{
config,
inputs,
lib,
pkgs,
...
}:
{
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;
merge = inputs.self.lib.mergeUsersOption lib;
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.shell.users)
);
programs.zsh.enable = config.my.shell.type == "zsh";
};
}