commit - 83bc7cfdcca77ad326721a0a3a4eca57ca551a63
commit + 42bcfde721444d21017f700fe135c6a09b27475f
blob - 5203b338e7684b4b4f8c006d004ae791ec67d944
blob + 8aca8962a1c0d91d192072cffb1675bce1a017eb
--- .gitattributes
+++ .gitattributes
hosts/impish/overlays/config/sccache/config filter=git-crypt diff=git-crypt
hosts/impish/overlays/config/newsraft/feeds filter=git-crypt diff=git-crypt
hosts/impish/overlays/config/twitch/channels filter=git-crypt diff=git-crypt
+hosts/impish/overlays/config/shepherd/init.d/mpd.scm filter=git-crypt diff=git-crypt
# work
hosts/work/** filter=git-crypt diff=git-crypt
blob - cd2f5785e39451598256d33f38cc600e9e4107a6
blob + 472beb9d1a7b1952ce9fb8a3b0d24d3302ca4c8b
--- flake.lock
+++ flake.lock
]
},
"locked": {
- "lastModified": 1788487777,
- "narHash": "sha256-Ro/e1N4ZR8/XaFF+sF9SgfPK79HM5YNEppzFj8p+0Ak=",
+ "lastModified": 1788620682,
+ "narHash": "sha256-qdXXcNrxlA35KvMH8yxlQen3pyJnV7yMDbv1QOOIOBQ=",
"owner": "nix-community",
"repo": "home-manager",
- "rev": "693e8ce0fb240a73c116a03cfd7b19269c87af88",
+ "rev": "8381f3481e4424ea0b53c9e7469c14da799d5822",
"type": "github"
},
"original": {
},
"nixpkgs_3": {
"locked": {
- "lastModified": 1788400875,
- "narHash": "sha256-JIHQ6xNAN53cdo6zZ72LRcQ9lpvnABCnNE4hldJ5uZU=",
+ "lastModified": 1788431191,
+ "narHash": "sha256-MFClkboDeW56feBCAeAV3Z3J2quGSZFlAOXQ4JjIlIA=",
"owner": "NixOS",
"repo": "nixpkgs",
- "rev": "5545adfad2e98de106a5544ca7067e03010410bd",
+ "rev": "9b9402b959a2276982ddd5ad3652a38b97f7c40b",
"type": "github"
},
"original": {
blob - eaa57876a5f21c1322454748bc288c642aa16b93
blob + 43481c80d053e5b9e1bb39c75bf5883ed90b1ee6
--- hosts/impish/default.nix
+++ hosts/impish/default.nix
butane
redo-sh
knit
+ go-task
];
debug = [
perf
hyperfine
cntr
- radare2
semgrep
];
];
llm = [
- ollama
- codex
- snip
+ rtk
+ gitingest
pi-coding-agent
];
blob - ec37fdd9b058a3d9a20c9adf039e5742aed5cba4
blob + d12d77091605117a358de813c5664584e38f34fe
Binary files hosts/impish/overlays/config/newsraft/feeds and hosts/impish/overlays/config/newsraft/feeds differ
blob - 1ab58213557383823683d0f9728a31efdb52fd9f
blob + 1e6b9c884203b856c0f3ebc778b7f3f774bf7f81
--- hosts/impish/overlays/config/shepherd/init.d/hawk-watch.scm
+++ hosts/impish/overlays/config/shepherd/init.d/hawk-watch.scm
(use-modules (helpers))
(exec-service 'hawk-watch
- (list "/home/miro/bin/hawk-watch"))
+ (list (string-append (home) "/bin/hawk-watch")))
;;; hawk-watch.scm ends here
blob - e94a4cd990947226d35631d6fb81607ef13efa1f
blob + 9ba959dd49a8208ef195f264efea863b0b3f025f
--- hosts/impish/overlays/config/shepherd/init.d/hawk.scm
+++ hosts/impish/overlays/config/shepherd/init.d/hawk.scm
(use-modules (helpers))
(exec-service 'hawk
(list "darkhttpd"
- "/home/miro/hawk"
+ (string-append (home) "/hawk")
"--addr"
"127.0.0.1"
"--port"
blob - /dev/null
blob + ed1de058838f2575e532f8d478dcf9dbd04d0690 (mode 644)
Binary files /dev/null and hosts/impish/overlays/config/shepherd/init.d/mpd.scm differ
blob - 8bdcd0f4bfce04cc3576f3f0eddc71407cc3d370
blob + 40a55e4dd45bd3945350f48d38a091ba13966da0
--- hosts/impish/overlays/config/shepherd/init.d/wbg.scm
+++ hosts/impish/overlays/config/shepherd/init.d/wbg.scm
(exec-service 'wbg
(list "wbg"
"--stretch"
- "/home/miro/misc/random/wallpapers/waterfall.jpg"))
+ (string-append (home) "/misc/random/wallpapers/waterfall.jpg")))
;;; wbg.scm ends here
blob - 52caf5cd1a6a31b95b946f3eead40bbe4ce489e4
blob + 4071c6aca96513a009efcbcc9dc67aa05e7cf4a8
--- hosts/impish/overlays/config/shepherd/modules/helpers.scm
+++ hosts/impish/overlays/config/shepherd/modules/helpers.scm
#:export (exec-service
replace-service!
xdg-config-file
- xdg-data-file))
+ xdg-data-file
+ home))
+(define (home)
+ (or (getenv "HOME") user-homedir))
+
(define (xdg-dir variable fallback)
(let ((value (getenv variable)))
(if (and value (not (string-null? value)))
value
- (string-append user-homedir fallback))))
+ (string-append (home) fallback))))
(define (xdg-config-file . parts)
(string-join (cons (xdg-dir "XDG_CONFIG_HOME" "/.config") parts) "/"))
blob - f8dc4a869af671143e7c932782cce0390e4349f9
blob + ecaf0687b8e68c291c54ecef7e322d8fab66ddf1
--- hosts/void/default.nix
+++ hosts/void/default.nix
];
llm = [
- ollama
codex
opencode
snip
blob - 00dd1306fede1d59b60815a413ca4cb9597adc45
blob + 01d23f0865471a3c29c406b30b3e45853f3941bf
Binary files hosts/void/overlays/config/shell/rc/void and hosts/void/overlays/config/shell/rc/void differ
blob - ab7a1ba8d6341946878a52de392dd86ad0122797
blob + 54511b4252d0dd28096b53b59d583698ae4c28cb
Binary files hosts/work/default.nix and hosts/work/default.nix differ
blob - 4d3eefbc558d5b9dfcccd0fdce8d722dd9b83e97
blob + 24a976b66ea28bb6e82259c7c94add065df346ce
Binary files hosts/work/overlays/config/shell/overrides and hosts/work/overlays/config/shell/overrides differ
blob - 19b526d58a07f3bf3e83fa5e27abd80228d1087e (mode 644)
blob + /dev/null
--- modules/mixins/dotfiles/bin/alpaca_shell
+++ /dev/null
-#!/usr/bin/env bash
-# alpaca_shell - lightweight interactive shell on top of alpaca
-#
-
-set -euo pipefail
-trap 'printf "\n"; exit 130' INT
-
-messages=(
- "--system" "You help convert natural language into safe macOS shell commands. Reply with exactly one directive per turn. Emit shell commands without any prefix. Narrate or ask questions using '!print ' lines only; never send plain text without '!print'. Do not ask the user to provide commands—propose the next step yourself. Only ask clarifying questions when essential, prefacing them with '!print ?'. When the task is complete, reply with '!stop'. After every command I run, I send you another user message that begins with 'Command output:'. Use that context before choosing the next step."
- "--user" "show the current working directory"
- "--assistant" "pwd"
- "--user" 'Command output:\n/Users/example'
- "--assistant" "!stop"
- "--user" "print hello world to the terminal"
- "--assistant" 'echo "Hello, world!"'
- "--user" 'Command output:\nHello, world!'
- "--assistant" "!stop"
-)
-
-while true; do
- if ! read -erp 'alpaca> ' request; then
- printf "\n"
- break
- fi
- [[ "$request" =~ ^[[:space:]]*$ ]] && continue
- [[ "$request" == ":quit" || "$request" == ":exit" ]] && break
-
- messages+=(--user "$request")
-
- while true; do
- response=$(alpaca "${messages[@]}")
- response=${response//$'\r'/}
- directive=${response%%$'\n'*}
-
- if [[ -z "$directive" ]]; then
- printf 'No response from model.\n' >&2
- break
- fi
-
- messages+=(--assistant "$directive")
-
- if [[ "$directive" == "!stop" ]]; then
- break
- fi
-
- if [[ "$directive" == "!print"* ]]; then
- text=${directive#!print}
- text=${text# }
- [[ -n "$text" ]] && printf '%s\n' "$text"
- messages+=(--user "Narration displayed.")
- continue
- fi
-
- if [[ "$directive" == \!* ]]; then
- printf '%s\n' "${directive:1}"
- messages+=(--user "Message shown to user.")
- continue
- fi
-
- treat_as_command=0
- if [[ "$directive" =~ ^[^[:space:]]+= ]]; then
- treat_as_command=1
- else
- first_word=${directive%%[[:space:]]*}
- if [[ -z "$first_word" ]]; then
- treat_as_command=0
- elif command -v "$first_word" >/dev/null 2>&1; then
- treat_as_command=1
- else
- treat_as_command=0
- fi
- fi
-
- if [[ $treat_as_command -eq 0 ]]; then
- printf '%s\n' "$directive"
- messages+=(--user "Narration displayed.")
- continue
- fi
-
- printf '+ %s\n' "$directive"
- if output=$(bash -lc "$directive" 2>&1); then
- [[ -n "$output" ]] && printf '%s\n' "$output"
- if [[ -n "$output" ]]; then
- messages+=("--user" $'Command output:\n'"$output")
- else
- messages+=("--user" "Command output: (no output)")
- fi
- else
- exit_status=$?
- [[ -n "$output" ]] && printf '%s\n' "$output"
- printf 'Command failed (exit %d)\n' "$exit_status" >&2
- if [[ -n "$output" ]]; then
- printf -v failure_output 'Command output (exit %d):\n%s' "$exit_status" "$output"
- else
- printf -v failure_output 'Command output (exit %d): (no output)' "$exit_status"
- fi
- messages+=("--user" "$failure_output")
- fi
- done
-done
blob - 92474ae8459742b8cf6c1d6e42e02e6293567c6b
blob + f7e89e6ed912be88257ad76d868a013c8adad5f3
--- modules/mixins/dotfiles/bin/plsmenu
+++ modules/mixins/dotfiles/bin/plsmenu
playlist="$choice"
fi
-eval "$("$HOME/bin/amen")" && zsh -c "mpd_add_to_playlist '$playlist'"
+if eval "$("$HOME/bin/amen")" && zsh -c "mpd_add_to_playlist '$playlist'"; then
+ notify-send -u normal "mpd" "saved a track to $playlist"
+ exit 0
+else
+ notify-send -u critical "mpd" "could not save a track"
+ exit 1
+fi
blob - /dev/null
blob + e3d5063e4cfc82737d397f7678b74fe4bfa4017c (mode 644)
--- /dev/null
+++ modules/mixins/dotfiles/bin/tuped
+#!/usr/bin/env janet
+# tuped — foreground spiped client tunnel
+
+# Runs spiped in client mode (-e). A local plaintext port forwards through an
+# encrypted and authenticated pipe to a remote spiped listener. Any TCP
+# protocol can use the tunnel.
+
+(def defaults
+ @{:host "127.0.0.1"
+ :remote-port 0
+ :local-port 0
+ :bind "127.0.0.1"
+ :key nil
+ :max-conns 8
+ :timeout 5})
+
+(def usage
+ ``
+ usage: tuped [options]
+
+ Foreground spiped client tunnel. Forwards a local plaintext port to a remote
+ spiped listener. You must give --remote-port, --local-port and --key.
+
+ --bind ADDR local bind address (default 127.0.0.1)
+ --local-port N local plaintext port (required)
+ --remote-port N remote spiped port (required)
+ --host HOST remote host (default 127.0.0.1)
+ --key FILE spiped key file (required)
+ --max-conns N spiped -n (default 8)
+ --timeout N spiped -o handshake timeout in seconds (default 5)
+ -h, --help show this message
+ ``)
+
+(defn- die [& parts]
+ (eprint "tuped: " ;(map string parts))
+ (os/exit 1))
+
+(def- flags
+ {"--bind" [:bind identity]
+ "--local-port" [:local-port scan-number]
+ "--remote-port" [:remote-port scan-number]
+ "--host" [:host identity]
+ "--key" [:key identity]
+ "--max-conns" [:max-conns scan-number]
+ "--timeout" [:timeout scan-number]})
+
+(defn parse-args [args]
+ (def opts (table/clone defaults))
+ (var i 0)
+ (while (< i (length args))
+ (def arg (args i))
+ (cond
+ (or (= arg "-h") (= arg "--help")) (do (print usage) (os/exit 0))
+ (flags arg)
+ (do
+ (def [key parse] (flags arg))
+ (++ i)
+ (when (>= i (length args)) (die arg " needs a value"))
+ (def value (parse (args i)))
+ (unless value (die "bad value for " arg ": " (args i)))
+ (put opts key value))
+ (die "unknown argument " arg "\n" usage))
+ (++ i))
+ opts)
+
+(defn- have-spiped []
+ (def out (file/open "/dev/null" :w))
+ (def found
+ (try (zero? (os/execute ["spiped" "-v"] :p {:out out :err out}))
+ ([_] false)))
+ (file/close out)
+ found)
+
+(defn- check-key [path]
+ (def st (os/stat path))
+ (unless st (die "spiped key not found: " path))
+ (when (= (st :mode) :link) (die "spiped key must not be a symlink: " path))
+ (unless (= (st :size) 32) (die "spiped key must be exactly 32 bytes: " path)))
+
+(defn- tunnel [opts]
+ (def source (string (opts :bind) ":" (opts :local-port)))
+ (def target (string (opts :host) ":" (opts :remote-port)))
+ (printf "%s -> %s (spiped -e, key %s)" source target (opts :key))
+ (def args
+ ["spiped" "-e" "-F"
+ "-s" source
+ "-t" target
+ "-k" (opts :key)
+ "-n" (string (opts :max-conns))
+ "-o" (string (opts :timeout))])
+ (try (os/spawn args :p)
+ ([err] (die "failed to start spiped: " err))))
+
+(defn main [& args]
+ (def argv (slice args 1))
+ (when (empty? argv)
+ (print usage)
+ (os/exit 0))
+ (def opts (parse-args argv))
+ (unless (have-spiped) (die "spiped not found on PATH (install net/spiped)"))
+ (unless (opts :key) (die "--key is required"))
+ (when (zero? (opts :local-port)) (die "--local-port is required"))
+ (when (zero? (opts :remote-port)) (die "--remote-port is required"))
+ (check-key (opts :key))
+ (def proc (tunnel opts))
+ (print "Press Ctrl-C to stop.")
+ (def code (try (os/proc-wait proc) ([_] -1)))
+ (printf "tunnel exited (code %d)" code)
+ (os/exit (if (zero? code) 0 1)))
blob - fff600caca5826c525079c7c3e4e2620354f07c1
blob + b2ea47171a8a46947883e5cc6f4667c23831bbd4
--- modules/mixins/dotfiles/config/zsh/rc/llm
+++ modules/mixins/dotfiles/config/zsh/rc/llm
#!/bin/bash
-alias alpac='alpaca compose'
+alias pajolo='paj --yolo'
+alias alpaco='alpaca compose'
alias alpacc='alpaca compose --continue'
-alias alpaq='alpaca quota --provider ollama'
-alias alpaqo='alpaca quota --provider openai'
-alias alpaqa='alpaca quota --provider anthropic'
-alias alpaqdi='alpaca quota --provider deepinfra'
-ollama_agent_marker="${XDG_RUNTIME_DIR:-/tmp}/ollama-agent-$(id -u)"
-
-ollama_stop_if_unused() {
- [ -f "$ollama_agent_marker" ] || return
- if ! pgrep -f "[c]odex|[p]i" >/dev/null 2>&1; then
- pkill -f "ollama serve"
- rm -f "$ollama_agent_marker"
- fi
-}
-
pi_recent_models() {
local n=${1:-10}
local session_dir="${HOME}/.pi/agent/sessions"
head -n "$n"
}
-codex() {
- [ "$PWD" = "$HOME" ] && return
- local isolate="pisol"
- [ "${1:-}" = "--yolo" ] && {
- isolate=
- shift
- }
-
- if [[ -n "$isolate" ]]; then
- command "$isolate" codex "$@"
- else
- command codex "$@"
- fi
-}
-
-cod() {
- [ "$PWD" = "$HOME" ] && return
- local isolate="pisol"
- [ "${1:-}" = "--yolo" ] && {
- isolate=
- shift
- }
- local codex_dir="${CODEX_DIR:-$HOME/.codex}"
- local profile
-
- profile=$(find "$codex_dir" -maxdepth 1 -name '*.config.toml' -printf '%f\n' |
- sed 's/\.config\.toml$//' |
- grep -v '^ollama-launch$' |
- fzf \
- --preview="cat '$codex_dir/{}.config.toml'" \
- --preview-window=up:2)
-
- [[ -n "$profile" ]] || return
-
- if ! pgrep -f "[o]llama serve" >/dev/null 2>&1; then
- ollama serve 2>&1 | vlogger -t ollama &
- disown
- : >"$ollama_agent_marker"
- fi
-
- $isolate codex --profile "$profile"
-
- ollama_stop_if_unused
-}
-
paj() {
[ "$PWD" = "$HOME" ] && return
local isolate="pisol" model args