Rebuild dotfiles as one branch with per-host layers

Replaces the previous repo, which had split into two histories that never
met (mainframe on a dead GitLab remote, the laptops on Gitea) with 146
dirty files across three machines and the NAS never enrolled at all.

Branch-per-machine is gone. One main, with host differences expressed as
small files under hosts/<hostname>/ rather than as branches, so there is
nothing to merge. The reconciled zsh layer reduces 15-33 line forks to
1-7 effective lines per host; distro differences (oh-my-zsh prefix,
syntax-highlighting path, fd vs fdfind) are probed in common/ instead.

Fresh history: the old one carried six plaintext credentials, 45 MB of
mail caches, browser caches and vendored binaries. 5,096 tracked files
and 144 MB become 462 files and 2.6 MB. The .gitignore is now an
allowlist, which is what keeps that true.

Root cause of the rot: ~/.local/bin was a symlink to scripts/ with GOPATH
inside it, so every go install wrote into version control (2.2 GB on the
work laptop). PATH now points at the repo instead of the reverse.

Also: Hyprland replaces sway and is sourced in two halves so $browser is
defined before use; singleton automations carry ConditionHost= alongside
host-layer-only placement; ddns moves from cron to a guarded timer;
package manifests and pkg-snapshot/pkg-restore replace the X11-era
install_scripts/; networkmanager-dmenu added to system76 (the binding
always existed, the package never did).
This commit is contained in:
2026-09-14 14:24:37 -04:00
commit e6644d0616
462 changed files with 23524 additions and 0 deletions
+34
View File
@@ -0,0 +1,34 @@
#!/usr/bin/env bash
# OnFailure= handler for the restic units. Invoked by systemd with the failed
# unit's name as $1.
#
# Why this exists: restic-backup notifies from inside the script, but
# restic-check calls /usr/bin/restic directly and restic-seed had no notify at
# all. Both could therefore fail completely silently -- and on 2026-08-21 the
# seed did exactly that, dying on a dropped SFTP connection and leaving a stale
# lock that then failed the Sunday check, with nothing said for three days.
# "Silence is the alarm" only works if every unit can actually raise one.
set -uo pipefail
UNIT=${1:-unknown.service}
NTFY_URL=https://ntfy.rcjohnstone.com/backup
for f in /etc/ntfy/publish.env /home/connor/.config/ntfy/publish.env; do
[ -r "$f" ] && { NTFY_ENV=$f; break; }
done
[ -n "${NTFY_ENV:-}" ] || exit 0
# PARSED, not sourced -- the bot password contains ` and &, so sourcing dies
# with a syntax error. Same reason restic-backup's notify() uses sed.
u=$(sed -n 's/^NTFY_USER=//p' "$NTFY_ENV" | head -1)
p=$(sed -n 's/^NTFY_PASS=//p' "$NTFY_ENV" | head -1)
[ -n "$u" ] && [ -n "$p" ] || exit 0
HOST=$(uname -n); HOST=${HOST%%.*}
RESULT=$(systemctl show -p Result --value "$UNIT" 2>/dev/null)
BODY=$(printf '%s failed on %s (Result=%s)\n\n%s\n' \
"$UNIT" "$HOST" "$RESULT" \
"$(journalctl -u "$UNIT" -n 20 --no-pager -o cat 2>/dev/null | tail -c 1200)")
curl -fsS --max-time 20 -u "$u:$p" \
-H "Title: $HOST: $UNIT FAILED" -H "Priority: urgent" -H "Tags: rotating_light" \
-d "$BODY" "$NTFY_URL" >/dev/null || true