Adjust default shell option

This commit is contained in:
Joshua Yuen 2025-07-26 03:41:00 -04:00
parent 4d3330d4f3
commit f46f67dd71
Signed by: josh
GPG Key ID: 502720BC22ED411C
4 changed files with 29 additions and 9 deletions

View File

@ -13,8 +13,7 @@
]; ];
modules.hyprland.enable = true; modules.hyprland.enable = true;
modules.zsh = {
enable = false; modules.zsh.enable = true;
defaultShell = true; modules.shell.defaultShell = "zsh";
};
} }

View File

@ -11,7 +11,7 @@
}: }:
with lib; with lib;
let let
zshCfg = config.modules.zsh; shellCfg = config.modules.shell;
in in
{ {
imports = [ inputs.home-manager.nixosModules.home-manager ]; imports = [ inputs.home-manager.nixosModules.home-manager ];
@ -37,10 +37,7 @@ in
extraGroups = [ extraGroups = [
"wheel" "wheel"
]; ];
shell = mkMerge [ shell = pkgs.${shellCfg.defaultShell};
(mkIf (zshCfg.enable && zshCfg.defaultShell) pkgs.zsh)
(mkIf (!zshCfg.enable || !zshCfg.defaultShell) pkgs.bash)
];
ignoreShellProgramCheck = true; ignoreShellProgramCheck = true;
}; };

View File

@ -4,6 +4,7 @@
{ {
imports = [ imports = [
./hyprland.nix ./hyprland.nix
./shell.nix
./zsh.nix ./zsh.nix
]; ];
} }

23
modules/options/shell.nix Normal file
View File

@ -0,0 +1,23 @@
{
config,
lib,
...
}:
with lib;
let
cfg = config.modules.shell;
in
{
options.modules.shell = {
defaultShell = mkOption {
type = types.enum [
"bash"
"zsh"
];
default = "zsh";
description = ''
The default shell to use for your user account.
'';
};
};
}