idk some stuff, mostly 25.11 and opencode stuff

This commit is contained in:
Anish Lakhwara
2026-02-01 23:39:21 -08:00
parent cd8bb0fe0f
commit 615ea7b026
33 changed files with 992 additions and 914 deletions
+156 -148
View File
@@ -1,158 +1,167 @@
{ lib, pkgs, config, ... }:
{
home.packages = with pkgs; [
binutils
coreutils
dnsutils
dasht
dosfstools
#git
git-machete
bottom
gptfdisk
difftastic
starship
jq
manix
moreutils
nix-index
cached-nix-shell
nmap
ripgrep
skim
tealdeer
usbutils
utillinux
whois
iftop
wget
curl
eza
bat
fd
ncdu
dust
# dia-cli
duf
trash-cli
nix-index
silver-searcher
tcpdump
mtr
file
lsof
atool
zip
unzip
rsync
tmux
pwgen
glow
pass
less
gdb
xxd
taskwarrior2
gnupg
syncthing
dijo
nixfmt-rfc-style
nix-tree
#ssb-patchwork
fontconfig
pandoc
taskwarrior-tui
# vimwiki-cli
zk
lib,
pkgs,
config,
...
}:
{
home.packages =
with pkgs;
[
binutils
coreutils
dnsutils
dasht
dosfstools
#git
git-machete
bottom
gptfdisk
difftastic
starship
jq
manix
moreutils
nix-index
cached-nix-shell
nmap
ripgrep
skim
tealdeer
usbutils
utillinux
whois
iftop
wget
curl
eza
bat
fd
ncdu
dust
# dia-cli
duf
trash-cli
nix-index
silver-searcher
tcpdump
mtr
file
lsof
atool
zip
unzip
rsync
tmux
pwgen
glow
pass
less
gdb
xxd
taskwarrior2
gnupg
syncthing
dijo
nixfmt-rfc-style
nix-tree
#ssb-patchwork
fontconfig
pandoc
taskwarrior-tui
# vimwiki-cli
zk
radicle-node # rad CLI for interacting with Radicle repos
(pkgs.writeScriptBin "jq-repl" ''
#!/usr/bin/env bash
if [[ -z $1 ]] || [[ $1 == "-" ]]; then
input=$(mktemp)
trap "rm -f $input" EXIT
cat /dev/stdin > $input
else
input=$1
fi
(pkgs.writeScriptBin "jq-repl" ''
#!/usr/bin/env bash
if [[ -z $1 ]] || [[ $1 == "-" ]]; then
input=$(mktemp)
trap "rm -f $input" EXIT
cat /dev/stdin > $input
else
input=$1
fi
echo "" \ | fzf --phony --preview-window="up:90%" --print-query --preview "jq --color-output -r {q} $input"
'')
(pkgs.writeScriptBin "clear-vim-trash" (builtins.readFile ./bin/clear-vim-trash.sh))
(pkgs.writeScriptBin "flakify" ''
#!/usr/bin/env zsh
if [ ! -e flake.nix ]; then
nix flake new -t github:nix-community/nix-direnv .
elif [ ! -e .envrc ]; then
echo "use flake" > .envrc
direnv allow
fi
vim flake.nix
'')
(pkgs.writeScriptBin "mx" ''
#!/usr/bin/env bash
manix "" | grep '^# ' | sed 's/^# \(.*\) (.*/\1/;s/ (.*//;s/^# //' | fzf --preview="manix '{}'" | xargs manix
'')
(pkgs.writeScriptBin "monitor" ''
connect() {
# Turn it on if it was off
xrandr --output HDMI-2 --auto
xrandr --output HDMI-2 --same-as eDP-1
xrandr --output eDP-1 --off
pkill -9 polybar
feh --bg-scale ~/Downloads/stephen-walker-onIXxjH56AA-unsplash.jpg
polybar mybar > $XDG_DATA_HOME/polybar.log 2>&1 &
}
echo "" \ | fzf --phony --preview-window="up:90%" --print-query --preview "jq --color-output -r {q} $input"
'')
(pkgs.writeScriptBin "clear-vim-trash" (builtins.readFile ./bin/clear-vim-trash.sh))
(pkgs.writeScriptBin "flakify" ''
#!/usr/bin/env zsh
if [ ! -e flake.nix ]; then
nix flake new -t github:nix-community/nix-direnv .
elif [ ! -e .envrc ]; then
echo "use flake" > .envrc
direnv allow
fi
vim flake.nix
'')
(pkgs.writeScriptBin "mx" ''
#!/usr/bin/env bash
manix "" | grep '^# ' | sed 's/^# \(.*\) (.*/\1/;s/ (.*//;s/^# //' | fzf --preview="manix '{}'" | xargs manix
'')
(pkgs.writeScriptBin "monitor" ''
connect() {
# Turn it on if it was off
xrandr --output HDMI-2 --auto
xrandr --output HDMI-2 --same-as eDP-1
xrandr --output eDP-1 --off
pkill -9 polybar
feh --bg-scale ~/Downloads/stephen-walker-onIXxjH56AA-unsplash.jpg
polybar mybar > $XDG_DATA_HOME/polybar.log 2>&1 &
}
disconnect() {
xrandr --output HDMI-2 --off
xrandr --output eDP-1 --auto
}
disconnect() {
xrandr --output HDMI-2 --off
xrandr --output eDP-1 --auto
}
xrandr | grep "HDMI-2 connected" &>>/dev/null && connect || disconnect
'')
(pkgs.writeScriptBin "big-monitor" ''
connect() {
# Turn it on if it was off
xrandr --output HDMI-2 --auto --primary
# Disable normal display
xrandr --output eDP-1 --off
# Use a nice background
feh --bg-scale ~/Downloads/stephen-walker-onIXxjH56AA-unsplash.jpg
# Reload Polybar
~/.config/bspwm/rc.d/polybar
}
xrandr | grep "HDMI-2 connected" &>>/dev/null && connect || disconnect
'')
(pkgs.writeScriptBin "big-monitor" ''
connect() {
# Turn it on if it was off
xrandr --output HDMI-2 --auto --primary
# Disable normal display
xrandr --output eDP-1 --off
# Use a nice background
feh --bg-scale ~/Downloads/stephen-walker-onIXxjH56AA-unsplash.jpg
# Reload Polybar
~/.config/bspwm/rc.d/polybar
}
disconnect() {
xrandr --output HDMI-2 --off
}
disconnect() {
xrandr --output HDMI-2 --off
}
xrandr | grep "HDMI-2 connected" &>>/dev/null && connect || disconnect
'')
(pkgs.writeScriptBin "disconnect-keyboard" ''
# keyboard on curve is busted
get_keyboard_id() {
xinput list | grep 'AT Translated Set' | cut -f2 | cut -d'=' -f2 | xinput float
}
xrandr | grep "HDMI-2 connected" &>>/dev/null && connect || disconnect
'')
(pkgs.writeScriptBin "disconnect-keyboard" ''
# keyboard on curve is busted
get_keyboard_id() {
xinput list | grep 'AT Translated Set' | cut -f2 | cut -d'=' -f2 | xinput float
}
disconnect_keyboard() {
id=$(get_keyboard_id)
xinput float $id
unset id
}
disconnect_keyboard() {
id=$(get_keyboard_id)
xinput float $id
unset id
}
attach_keyboard() {
id=$(get_keyboard_id)
xinput reattach $id 3
unset id
}
attach_keyboard() {
id=$(get_keyboard_id)
xinput reattach $id 3
unset id
}
disconnect_keyboard
'')
] ++ lib.optionals pkgs.stdenv.isLinux [
# Linux-only packages
iputils
strace
];
disconnect_keyboard
'')
]
++ lib.optionals pkgs.stdenv.isLinux [
# Linux-only packages
iputils
strace
];
programs.zsh = {
enable = true;
@@ -246,7 +255,7 @@
yt = "ytfzf -T kitty -t ";
gen-secret = "< /dev/urandom tr -dc _A-Z-a-z-0-9 | head -c\${1:-32};echo;";
# modern cli tools
# modern cli tools
ls = "eza --icons";
l = "esa -l --icons";
la = "eza -la --icons";
@@ -255,12 +264,11 @@
unzip = "aunpack";
copy = if pkgs.stdenv.isDarwin then "pbcopy" else "xclip -selection clipboard";
paste = if pkgs.stdenv.isDarwin then "pbpaste" else "xclip -selection clipboard -o";
rm = "echo USE TRASH, FOOL: trash ";
trash = "trash-put";
make-secret = "< /dev/urandom \\tr -dc _A-Za-z0-9 | head -c \${1:-32};echo;";
# task warrior
t = "task -BLOCKED -idea -backlog";
t = "task -BLOCKED -idea -backlog";
tw = "t rc.context:work";
# TODO find a reasonable way to manage this from a non-nix managed file in ~/.task/context or something
# we can do something like task rc.context:$(cat ~/.task/context) to read context