aboutsummaryrefslogtreecommitdiff
path: root/snowfall/modules/nixos/tools/bash/default.nix
blob: d3ec4bc2a68680d17c6274125db7cc32db0ae607 (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
{ options, config, lib, namespace, ... }:

with lib; with lib.${namespace}; let
  cfg = config.${namespace}.tools.bash;
in {
  options.${namespace}.tools.bash = with types; {
    enable = mkEnableOption "tools";
  };

  config = mkIf cfg.enable {
    #TODO: add c="codium ." alias
    programs.bash = {
      shellAliases = {
        lsa = "ls -lAsh";
        p = "nix-shell -p";
      };

      interactiveShellInit = ''
        source "${./prompt.sh}"

        mkcd() {
          mkdir -p "$1"
          cd "$1"
        }
      '';
    };
  };
}