config/users/pbsds/home/profiles/shell.nix

95 lines
2.2 KiB
Nix
Raw Normal View History

2023-03-04 00:09:57 +01:00
{ 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"
];
2023-07-05 17:30:17 +02:00
programs.bash.initExtra = ''
2023-07-19 22:59:12 +02:00
bind 'set completion-ignore-case on'
2023-07-05 17:30:17 +02:00
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
'';
2023-03-04 00:09:57 +01:00
2023-03-04 01:48:55 +01:00
imports = [ ../modules/jump.nix ];
programs.jump.enableBash = true; # TODO: upstream?
2023-03-04 00:09:57 +01:00
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;
2023-07-09 00:10:03 +02:00
#programs.direnv.nix-direnv.enable = true;
2023-03-04 00:09:57 +01:00
programs.tealdeer.enable = true;
# just use ncdu lol
home.shellAliases.dush = "du -shc * | sort -h";
home.shellAliases.dushd = "du -shc * .[!.]?* | sort -h";
2023-06-14 12:24:53 +02:00
home.shellAliases.open = "xdg-open";
2023-03-04 00:09:57 +01:00
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
2023-07-05 13:34:19 +02:00
bind.dnsutils # dig
2023-03-04 00:09:57 +01:00
vimv
git
curl
wget
2023-03-11 03:39:06 +01:00
sshuttle
2023-03-04 00:09:57 +01:00
#tldr
entr
2023-06-24 14:48:53 +02:00
axel aria aria2
2023-03-04 00:09:57 +01:00
xe # xargs alternative
sd # sed alternative
fd # find alternative
2023-03-11 03:39:06 +01:00
silver-searcher # 'ag'
ripgrep # 'rg'
2023-03-04 00:09:57 +01:00
gron
jq
2023-03-11 03:39:06 +01:00
yq # includes xmlq and tomlq
fq # binary jq
2023-03-04 00:09:57 +01:00
htmlq
2023-03-11 03:39:06 +01:00
just # justfile
2023-03-04 00:09:57 +01:00
sysz
du-dust # du alternative
ncdu # Disk usage analyzer with an ncurses interface
xplr # tui file explorer
aha
];
}