Files
nix-flake/modules/features/shells.nix
T

16 lines
686 B
Nix

{ inputs, self, ... }: {
imports = [ (inputs.helpers.mkMirroredModulesFlakeModule "globalOptions" ({ lib, ... }: {
options.features.shells.defaultShell = lib.mkOption {
type = inputs.helpers.mkEnumFromDirContents "${self}/modules/features/shells";
description = "The shell that should be used as the default for all users.";
default = "zsh";
};
})) ];
flake.nixosModules.global = { config, pkgs, lib, ... }: {
programs.${config.features.shells.defaultShell}.enable = true;
users.defaultUserShell = pkgs.${config.features.shells.defaultShell};
users.users."${config.info.userName}".shell = pkgs.${config.features.shells.defaultShell};
};
}