home/pbsds: moar

This commit is contained in:
Peder Bergebakken Sundt 2023-03-04 00:09:57 +01:00
parent e99df9db4d
commit 87b5d5733f
7 changed files with 122 additions and 100 deletions

View File

@ -2,8 +2,7 @@
{ pkgs, config, ... }:
{
# TODO: upstream?
programs.jump.enableBash = true;
programs.jump.enableBash = true; # TODO: upstream?
imports = [
./modules/jump.nix
@ -11,37 +10,27 @@
./profiles/git.nix
./profiles/gtk.nix
./profiles/micro.nix
./profiles/mpv.nix
./profiles/shell.nix
./profiles/ssh.nix
./profiles/tmate.nix
];
nixpkgs.config.allowUnfree = true;
home.stateVersion = "22.11";
home.stateVersion = "22.05";
home.sessionVariables.EDITOR = "micro";
programs.bash.initExtra = ''
if [ "$COLORTERM" = "truecolor" ] || [ "$TERM" == "xterm" ]; then
export TERM=xterm-256color
export MICRO_TRUECOLOR=1
fi
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\] '
# remote-exec
it command -v remote >/dev/null && remote-quick >/dev/null; then
complete -F _command remote
complete -F _command remote-quick
fi
# tldr
it command -v tldr >/dev/null; then
complete -F _command tldr
fi
# TODO: remove
function atom_nix {
nix-shell -p atom --run "atom $(printf "%q " "$@") --in-process-gpu --no-sandbox"
@ -49,10 +38,7 @@
'';
# TODO: split ^
home.packages = with pkgs; [
rsync
bind.dnsutils
xclip
zip
@ -64,11 +50,9 @@
gzip
atool
micro
aspell
aspellDicts.en
aspellDicts.nb
vimv
dos2unix
pandoc
@ -79,10 +63,6 @@
youtube-dl
ffmpeg-full
git
curl
wget
visidata
lolcat
@ -91,32 +71,10 @@
tewisay
ponysay
#tldr
entr
axel aria
xe # xargs alternative
sd # sed alternative
fd # find alternative
silver-searcher # `ag`
ripgrep
gron
jq
yq
fq
htmlq
just
sysz
du-dust # du alternative
ncdu # Disk usage analyzer with an ncurses interface
xplr # tui file explorer
aha
# TODO: move to graphical? kiosk?
mesa-demos
cage
gh
hub
librespeed-cli
cachix
@ -139,25 +97,15 @@
pyyaml
virtualenv
]))
];
home.shellAliases = {
ip = "ip -br -color";
watch = "watch -c ";
hman = "man -H ";
#igrep = "grep -i";
#flexget = "ssh -t knut.pbsds.net sudo -u flexget flexget";
flexget = "sudo --user=flexget flexget -c /var/lib/flexget/flexget.yml";
tmux = "systemd-run --scope --user tmux";
dush = "du -shc * | sort -h";
dushd = "du -shc * .[!.]?* | sort -h";
diff = "diff -u --color";
sudo = "sudo ";
xargs = "xargs ";
dc = "cd";
#sl = "ls";
sl = "exa";
rssh = "ssh -l root";
hman = "man -H "; # HTML opened in a browser
tmux = "systemd-run --scope --user tmux"; # detach from ssh scope, surviving logout
# TODO: wayland detection
clip = "xclip -sel clip -t text/plain -rmlastnl -i";
@ -176,37 +124,7 @@
nixpkgs-review = ''mkdir -p /dev/shm/nixpkgs-review && ln -sfn /dev/shm/nixpkgs-review $HOME/.cache/nixpkgs-review && nixpkgs-review'';
};
# 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.fzf.enable = true; # TODO: does this conflict with system-wide setup?
programs.exa.enable = true;
programs.exa.enableAliases = true;
programs.direnv.enable = true;
programs.mpv.enable = true;
programs.mpv.bindings."n" = "sub-seek 1";
programs.mpv.bindings."SHIFT+n" = "sub-seek -1";
#programs.mpv.config
programs.mpv.scripts = with pkgs.mpvScripts; [ thumbnail ];
programs.nix-index.enable = true;
programs.tealdeer.enable = true;
xdg.enable = true;
#xdg.desktopEntries

View File

@ -28,4 +28,6 @@
# only in unstable as of 22.11:
#extraPackages = with pkgs.bat-extras; [ batdiff batman batgrep batwatch ];
};
# TODO: generate bat syntax cache: 'bat cache --build'
}

View File

@ -1,5 +1,8 @@
{ pkgs, ... }:
{
home.packages = with pkgs; [ git gh hub ];
#programs.git.gitui.enable = true;
programs.git.enable = true;
programs.git.delta.enable = true;

View File

@ -6,6 +6,9 @@
home.shellAliases.ed = "$EDITOR"; # ed is the standard editor
home.shellAliases.de = "$EDITOR";
home.sessionVariables.EDITOR = "micro";
home.packages = with pkgs; [ micro ];
programs.micro.enable = true;
programs.micro.trueColor = true;

View File

@ -0,0 +1,10 @@
{ pkgs, ... }:
{
home.packages = with pkgs; [ mpv ];
programs.mpv.enable = true;
programs.mpv.bindings."n" = "sub-seek 1";
programs.mpv.bindings."SHIFT+n" = "sub-seek -1";
#programs.mpv.config
programs.mpv.scripts = with pkgs.mpvScripts; [ thumbnail ];
}

View File

@ -0,0 +1,86 @@
{ 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.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.tealdeer.enable = true;
# just use ncdu lol
home.shellAliases.dush = "du -shc * | sort -h";
home.shellAliases.dushd = "du -shc * .[!.]?* | sort -h";
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
vimv
git
curl
wget
#tldr
entr
axel aria
xe # xargs alternative
sd # sed alternative
fd # find alternative
silver-searcher # `ag`
ripgrep
gron
jq
yq
fq
htmlq
just
sysz
du-dust # du alternative
ncdu # Disk usage analyzer with an ncurses interface
xplr # tui file explorer
aha
];
programs.bash.initExtra = ''
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
it command -v tldr >/dev/null; then
complete -F _command tldr
fi
'';
}