]> Git — Sourcephile - julm/julm-nix.git/blob - homes/softwares/bash.nix
wireguard: fix listenPorts
[julm/julm-nix.git] / homes / softwares / bash.nix
1 { pkgs, lib, config, ... }:
2 {
3 programs.bash = {
4 shellAliases = {
5 grep = "grep --color";
6 md-toc = "grep '^#\\+' --color";
7 mpl = "mplayer";
8 rsync = "rsync --no-inc-recursive --info=progress2 --inplace --partial";
9 };
10 initExtra = ''
11 shopt -s globstar
12 # Disable ctrl-s/ctrl-q flow control
13 stty -ixon
14 vim-git () { $EDITOR $(git diff-tree --no-commit-id --name-only -r "$@"); }
15 zfs-mount () { for d in $(zfs list -rH -o name "$@"); do sudo zfs mount -l "$d"; done; }
16 zfs-unmount () { sudo zfs unmount -u "$@"; }
17 '';
18 };
19 programs.direnv.enableBashIntegration = true;
20 programs.broot.enableBashIntegration = true;
21 home.sessionVariables = {
22 PS1 = ''\[\033[1;32m\]\[\e]0;\u@\h: \w\a\]\W\[\033[0m\] \$(e=\$?; if [ \$e != 0 ]; then echo '\[\e[0;91m\]'\$e'\[\e[0m\]'; fi)\$ '';
23 };
24 home.file.".inputrc".text = ''
25 "\e[1~": beginning-of-line
26 "\e[4~": end-of-line
27 "\e[7~": beginning-of-line
28 "\e[8~": end-of-line
29 "\eOH": beginning-of-line
30 "\eOF": end-of-line
31 "\e[H": beginning-of-line
32 "\e[F": end-of-line
33 "\e[1;5C": forward-word
34 "\e[1;5D": backward-word
35 "\e[5C": forward-word
36 "\e[5D": backward-word
37 "\e\e[C": forward-word
38 "\e\e[D": backward-word
39 '';
40 }