aboutsummaryrefslogtreecommitdiff
path: root/snowfall/modules/nixos/tools/bash/default.nix
blob: 180db1f3d8f22107a5e701cec964c203b2cde826 (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
{ 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 {
    environment.localBinInPath = true;
    
    programs.bash = {
      shellAliases = {
        lsa = "ls -lAsh";
        p = "nix-shell -p";
      };

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

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