From bdf5331c964e80204caaa7e54a60ef69748f33ed Mon Sep 17 00:00:00 2001 From: Arpit Chakladar <54011232+arpitchakladar@users.noreply.github.com> Date: Sat, 28 Sep 2024 00:37:34 +0530 Subject: Added ability to change the default program if multiple programs for the same purpose are enabled. --- modules/shell/bash/default.nix | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'modules/shell/bash') diff --git a/modules/shell/bash/default.nix b/modules/shell/bash/default.nix index ee3b4a8..2e65d60 100644 --- a/modules/shell/bash/default.nix +++ b/modules/shell/bash/default.nix @@ -2,10 +2,20 @@ { options.shell.bash = { - enable = lib.mkEnableOption "Enables bash."; + enable = lib.mkOption { + type = lib.types.bool; + description = "Enables bash."; + default = true; + }; }; config = lib.mkIf config.shell.bash.enable { + shell.default = lib.mkDefault "bash"; + shell.command = + if config.shell.default == "bash" then + lib.mkForce "${pkgs.zsh}/bin/bash" + else ""; + programs.bash.enable = true; programs.bash.historyFile = "${config.xdg.cacheHome}/bash/history"; programs.bash.shellAliases = config.shell.alias; -- cgit v1.2.3