summaryrefslogtreecommitdiff
path: root/users/seth/shell/bash.nix
blob: bf5b377db317d735de9826be2a1534f3d4432129 (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
38
{ config, lib, ... }:
let
  cfg = config.seth.shell.bash;
in
{
  options.seth.shell.bash = {
    enable = lib.mkEnableOption "Bash configuration" // {
      default = config.seth.enable;
      defaultText = lib.literalExpression "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"
      ];
    };
  };
}