diff options
Diffstat (limited to 'modules/shell')
| -rw-r--r-- | modules/shell/bash/default.nix | 12 | ||||
| -rw-r--r-- | modules/shell/default.nix | 16 | ||||
| -rw-r--r-- | modules/shell/zsh/default.nix | 6 |
3 files changed, 26 insertions, 8 deletions
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; diff --git a/modules/shell/default.nix b/modules/shell/default.nix index 27a919a..c2eada9 100644 --- a/modules/shell/default.nix +++ b/modules/shell/default.nix @@ -8,17 +8,21 @@ options.shell = { default = lib.mkOption { + type = lib.types.enum [ + "bash" + "zsh" + ]; + description = "Default shell."; + }; + + command = lib.mkOption { type = lib.types.str; - description = "Path to the default shell program."; + description = "Command for the default shell."; }; + alias = lib.mkOption { type = lib.types.attrs; description = "Shell aliases."; }; }; - - config = { - shell.default = lib.mkDefault "${pkgs.bash}/bin/bash"; # Set bash as default shell - shell.bash.enable = lib.mkDefault true; # Enable bash by default - }; } diff --git a/modules/shell/zsh/default.nix b/modules/shell/zsh/default.nix index 7d7a261..0c14b8c 100644 --- a/modules/shell/zsh/default.nix +++ b/modules/shell/zsh/default.nix @@ -6,7 +6,11 @@ }; config = lib.mkIf config.shell.zsh.enable { - shell.default = "${pkgs.zsh}/bin/zsh"; + shell.default = lib.mkDefault "zsh"; + shell.command = + if config.shell.default == "zsh" then + lib.mkForce "${pkgs.zsh}/bin/zsh" + else ""; programs.zsh.enable = true; programs.zsh.dotDir = ".config/zsh"; |
