summaryrefslogtreecommitdiff
path: root/users/seth/shell/bash.nix
blob: 216e6091399d8c5a6942465423e7423ee9640daf (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
34
35
36
37
{
  config,
  lib,
  ...
}: let
  cfg = config.seth.shell.bash;
in {
  options.seth.shell.bash = {
    enable = lib.mkEnableOption "Bash configuration" // {default = config.seth.enable;};
  };

  config = lib.mkIf cfg.enable {
    programs.bash = {
      enable = true;

      # TODO: find out if i need this anymore with standalone HM
      bashrcExtra = ''
        nixfile=${config.home.homeDirectory}/.nix-profile/etc/profile.d/nix.sh
        [ -e "$nixfile" ] && source "$nixfile"
      '';

      historyFile = "${config.xdg.stateHome}/bash/history";
      historyFileSize = 1000;
      historySize = 100;

      shellOptions = [
        "cdspell"
        "checkjobs"
        "checkwinsize"
        "dirspell"
        "globstar"
        "histappend"
        "no_empty_cmd_completion"
      ];
    };
  };
}