config/users/pbsds/home/profiles/shell.nix
2024-02-17 17:51:49 +01:00

99 lines
2.3 KiB
Nix

{ pkgs, ... }:
{
# TODO: "bind -s 'set completion-ignore-case on'"
programs.bash.enable = true;
#programs.bash.enableCompletion = true;
programs.bash.shellOptions = [
# Append to history file rather than replacing it.
"histappend"
# check the window size after each command and, if
# necessary, update the values of LINES and COLUMNS.
"checkwinsize"
# Extended globbing.
"extglob"
"globstar"
# Warn if closing shell with running jobs.
"checkjobs"
];
programs.bash.initExtra = ''
bind 'set completion-ignore-case on'
parse_git_branch() {
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/'
}
export PS1='\[\033[01;32m\]\u@\h\[\033[01;37m\] \[\033[01;34m\]\W\[\033[33m\]$(parse_git_branch)\[\033[01;32m\]\$\[\033[00m\] '
# tldr
if command -v tldr >/dev/null; then
complete -F _command tldr
fi
'';
imports = [ ../modules/jump.nix ];
programs.jump.enableBash = true; # TODO: upstream?
programs.fzf.enable = true; # TODO: does this conflict with system-wide setup?
programs.exa.enable = true;
programs.exa.enableAliases = true;
# i can't type
home.shellAliases.sl = "exa";
home.shellAliases.dc = "cd";
programs.direnv.enable = true;
#programs.direnv.nix-direnv.enable = true;
programs.tealdeer.enable = true;
# just use ncdu lol
home.shellAliases.dush = "du -shc * | sort -h";
home.shellAliases.dushd = "du -shc * .[!.]?* | sort -h";
home.shellAliases.open = "xdg-open";
home.shellAliases.diff = "diff -u --color"; # eyo
home.shellAliases.ip = "ip -br -color";
home.shellAliases.rssh = "ssh -l root";
home.shellAliases.sudo = "sudo ";
home.shellAliases.watch = "watch -c "; # parse colors
home.shellAliases.xargs = "xargs ";
home.packages = with pkgs; [
rsync
bind.dnsutils # dig
dogdns # dog
vimv
git
curl
wget
sshuttle
#tldr
entr
axel aria aria2
xe # xargs alternative
sd # sed alternative
fd # find alternative
silver-searcher # 'ag'
ripgrep # 'rg'
comby
gron
jq
fx
yq # includes xmlq and tomlq
fq # binary jq
htmlq
just # justfile
gum
sysz
du-dust # du alternative
ncdu # Disk usage analyzer with an ncurses interface
xplr # tui file explorer
aha unstable.colorized-logs
];
}