diff --git a/hosts/vm/default.nix b/hosts/vm/default.nix index dbbb98b..3ed7bff 100644 --- a/hosts/vm/default.nix +++ b/hosts/vm/default.nix @@ -13,8 +13,7 @@ ]; modules.hyprland.enable = true; - modules.zsh = { - enable = false; - defaultShell = true; - }; + + modules.zsh.enable = true; + modules.shell.defaultShell = "zsh"; } \ No newline at end of file diff --git a/modules/core/user.nix b/modules/core/user.nix index b4b89f4..70be1f6 100644 --- a/modules/core/user.nix +++ b/modules/core/user.nix @@ -10,7 +10,7 @@ }: with lib; let - zshCfg = config.modules.zsh; + shellCfg = config.modules.shell; in { imports = [ inputs.home-manager.nixosModules.home-manager ]; @@ -36,10 +36,7 @@ in extraGroups = [ "wheel" ]; - shell = mkMerge [ - (mkIf (zshCfg.enable && zshCfg.defaultShell) pkgs.zsh) - (mkIf (!zshCfg.enable || !zshCfg.defaultShell) pkgs.bash) - ]; + shell = pkgs.${shellCfg.defaultShell}; ignoreShellProgramCheck = true; }; diff --git a/modules/options/default.nix b/modules/options/default.nix index c648c53..e7130be 100644 --- a/modules/options/default.nix +++ b/modules/options/default.nix @@ -4,6 +4,7 @@ { imports = [ ./hyprland.nix + ./shell.nix ./zsh.nix ]; } \ No newline at end of file diff --git a/modules/options/shell.nix b/modules/options/shell.nix new file mode 100644 index 0000000..9db5ad1 --- /dev/null +++ b/modules/options/shell.nix @@ -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. + ''; + }; + }; +} \ No newline at end of file