blob: fb1040abf29f0ac531c2952154daddf419c2580c (
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
25
26
27
28
29
30
31
32
33
|
{ 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;
programs.bash.bashrcExtra = ''
${if config.tools.fzf.enable then
"eval \"$(fzf --bash)\""
else ""}
'';
home.activation.createBashCacheDirectory
= lib.hm.dag.entryAfter
[ "writeBoundary" ]
"mkdir -p ${config.xdg.cacheHome}/bash";
};
}
|