{ 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"; }; }