aboutsummaryrefslogtreecommitdiffstats
path: root/modules/shell/bash/default.nix
blob: 2e65d60fd87b072cd2fabc13be6ef495a1b3f695 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
{ config, lib, pkgs, ... }:

{
	options.shell.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;
		home.file."${config.xdg.cacheHome}/bash/histroy".text = ""; # Create the cache directory and histroy file
	};
}