]> Git — Sourcephile - julm/julm-nix.git/blob - nixos/profiles/bash.nix
mermet: configure vim
[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 fan () {
17 if [ $# -gt 0 ]
18 then sudo tee /proc/acpi/ibm/fan <<<"level $1"
19 else grep '^\(level\|speed\):' /proc/acpi/ibm/fan
20 fi
21 acpi -t
22 }
23 '';
24 shellAliases = {
25 cl = "clear";
26 grep = "grep --color";
27 l = "ls -alh";
28 ll = "ls -al";
29 ls = "ls --color=tty";
30 mem = "ps -e -orss=,user=,args= | sort -b -k1,1n";
31
32 s="sudo systemctl";
33 st="sudo systemctl status";
34 u="systemctl --user";
35 j="sudo journalctl -u";
36 jb="sudo journalctl -b";
37
38 nix-history="sudo nix-env --list-generations --profile /nix/var/nix/profiles/system";
39 mv = "mv -i";
40 sshfs = "sshfs -o ServerAliveInterval=15 -o reconnect -f";
41 };
42 };