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

@ -16,14 +16,14 @@
# temp # temp
inputs.pr-polaris14.url = "github:pbsds/nixpkgs/polaris-14"; inputs.pr-polaris14.url = "github:pbsds/nixpkgs/polaris-14";
outputs = { outputs = {
self, self,
nixpkgs, nixpkgs,
unstable, unstable,
nixos-hardware, nixos-hardware,
nur, nur,
home-manager, home-manager,
... ...
} @ inputs: } @ inputs:
let let
systems = [ systems = [

View File

@ -2,8 +2,7 @@
{ pkgs, config, ... }: { pkgs, config, ... }:
{ {
# TODO: upstream? programs.jump.enableBash = true; # TODO: upstream?
programs.jump.enableBash = true;
imports = [ imports = [
./modules/jump.nix ./modules/jump.nix
@ -11,37 +10,27 @@
./profiles/git.nix ./profiles/git.nix
./profiles/gtk.nix ./profiles/gtk.nix
./profiles/micro.nix ./profiles/micro.nix
./profiles/mpv.nix
./profiles/shell.nix
./profiles/ssh.nix ./profiles/ssh.nix
./profiles/tmate.nix ./profiles/tmate.nix
]; ];
nixpkgs.config.allowUnfree = true; nixpkgs.config.allowUnfree = true;
home.stateVersion = "22.11";
home.stateVersion = "22.05";
home.sessionVariables.EDITOR = "micro";
programs.bash.initExtra = '' programs.bash.initExtra = ''
if [ "$COLORTERM" = "truecolor" ] || [ "$TERM" == "xterm" ]; then if [ "$COLORTERM" = "truecolor" ] || [ "$TERM" == "xterm" ]; then
export TERM=xterm-256color export TERM=xterm-256color
export MICRO_TRUECOLOR=1 export MICRO_TRUECOLOR=1
fi 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 # remote-exec
it command -v remote >/dev/null && remote-quick >/dev/null; then it command -v remote >/dev/null && remote-quick >/dev/null; then
complete -F _command remote complete -F _command remote
complete -F _command remote-quick complete -F _command remote-quick
fi fi
# tldr
it command -v tldr >/dev/null; then
complete -F _command tldr
fi
# TODO: remove # TODO: remove
function atom_nix { function atom_nix {
nix-shell -p atom --run "atom $(printf "%q " "$@") --in-process-gpu --no-sandbox" nix-shell -p atom --run "atom $(printf "%q " "$@") --in-process-gpu --no-sandbox"
@ -49,10 +38,7 @@
''; '';
# TODO: split ^ # TODO: split ^
home.packages = with pkgs; [ home.packages = with pkgs; [
rsync
bind.dnsutils
xclip xclip
zip zip
@ -64,11 +50,9 @@
gzip gzip
atool atool
micro
aspell aspell
aspellDicts.en aspellDicts.en
aspellDicts.nb aspellDicts.nb
vimv
dos2unix dos2unix
pandoc pandoc
@ -79,10 +63,6 @@
youtube-dl youtube-dl
ffmpeg-full ffmpeg-full
git
curl
wget
visidata visidata
lolcat lolcat
@ -91,32 +71,10 @@
tewisay tewisay
ponysay ponysay
#tldr # TODO: move to graphical? kiosk?
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
mesa-demos mesa-demos
cage cage
gh
hub
librespeed-cli librespeed-cli
cachix cachix
@ -139,25 +97,15 @@
pyyaml pyyaml
virtualenv virtualenv
])) ]))
]; ];
home.shellAliases = { 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 = "ssh -t knut.pbsds.net sudo -u flexget flexget";
flexget = "sudo --user=flexget flexget -c /var/lib/flexget/flexget.yml"; flexget = "sudo --user=flexget flexget -c /var/lib/flexget/flexget.yml";
tmux = "systemd-run --scope --user tmux";
dush = "du -shc * | sort -h"; hman = "man -H "; # HTML opened in a browser
dushd = "du -shc * .[!.]?* | sort -h";
diff = "diff -u --color"; tmux = "systemd-run --scope --user tmux"; # detach from ssh scope, surviving logout
sudo = "sudo ";
xargs = "xargs ";
dc = "cd";
#sl = "ls";
sl = "exa";
rssh = "ssh -l root";
# TODO: wayland detection # TODO: wayland detection
clip = "xclip -sel clip -t text/plain -rmlastnl -i"; 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''; 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.nix-index.enable = true;
programs.tealdeer.enable = true;
xdg.enable = true; xdg.enable = true;
#xdg.desktopEntries #xdg.desktopEntries

View File

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

View File

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

View File

@ -6,6 +6,9 @@
home.shellAliases.ed = "$EDITOR"; # ed is the standard editor home.shellAliases.ed = "$EDITOR"; # ed is the standard editor
home.shellAliases.de = "$EDITOR"; home.shellAliases.de = "$EDITOR";
home.sessionVariables.EDITOR = "micro";
home.packages = with pkgs; [ micro ];
programs.micro.enable = true; programs.micro.enable = true;
programs.micro.trueColor = 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
'';
}