]> Git — Sourcephile - julm/julm-nix.git/blob - nixos/profiles/bash.nix
nix: move some settings to nixos/profiles
[julm/julm-nix.git] / nixos / profiles / bash.nix
1 {
2 programs = {
3 bash = {
4 interactiveShellInit = ''
5 bind '"\e[A":history-search-backward'
6 bind '"\e[B":history-search-forward'
7
8 # Ignore duplicate commands, ignore commands starting with a space
9 export HISTCONTROL=erasedups:ignorespace
10 export HISTSIZE=42000
11 # Append to the history instead of overwriting (good for multiple connections)
12 shopt -s histappend
13
14 # Utilities
15 mkcd () { mkdir -p "$1"; cd "$1"; }
16 '';
17 shellAliases = {
18 cl = "clear";
19 grep = "grep --color";
20 l = "ls -alh";
21 ll = "ls -al";
22 ls = "ls --color=tty";
23 mem = "ps -e -orss=,user=,args= | sort -b -k1,1n";
24
25 s="sudo systemctl";
26 st="sudo systemctl status";
27 j="sudo journalctl -u";
28 jb="sudo journalctl -b";
29
30 nix-history="sudo nix-env --list-generations --profile /nix/var/nix/profiles/system";
31 mv = "mv -i";
32 };
33 };
34 };
35 }