Commit Graph
4124 Commits
Author SHA1 Message Date
Gabriel Fontes 561e34e976 feat(hosts/merope/sabnzbd): tune down memoryhigh to 4gb 2026-08-10 12:18:49 -03:00
Gabriel Fontes 4c7f42f4f6 fix(hosts/merope/sabnzbd): explicitly set cache_limit 2026-08-10 12:17:40 -03:00
Gabriel Fontes fcb65ede67 refactor(alcyone/grafana): migrate internet speed dashboard to v2
Strip generated resource metadata and v2 defaults while retaining the schema-required wrappers and dashboard behavior.

Assisted-by: pi (gpt-5.6-sol)
2026-08-10 12:01:40 -03:00
Gabriel Fontes 303ad14dde feat(hosts/alcyone/grafana): use bps for network rather than Bps 2026-08-10 12:00:54 -03:00
Gabriel Fontes b3c51812b9 feat(hosts/alcyone/grafan): don't hardcode rate intervals 2026-08-10 12:00:25 -03:00
Gabriel Fontes 07b1560191 refactor(alcyone/grafana): migrate hosts dashboard to v2
Strip generated resource metadata and v2 defaults while retaining the schema-required wrappers and dashboard behavior.

Assisted-by: pi (gpt-5.6-sol)
2026-08-10 11:52:29 -03:00
Gabriel Fontes 1d469dfd07 feat(hosts/alcyone/grafana): add internet speed dashboard 2026-08-10 11:38:16 -03:00
Gabriel Fontes 6a09a748c6 feat(merope): add speedtest prometheus exporter
Scrape the exporter from alcyone every five minutes.

Assisted-by: pi (gpt-5.6-sol)
2026-08-10 10:55:07 -03:00
Gabriel Fontes 4e33a17a53 fix(hosts/merope/sabnzbd): persist state 2026-08-10 10:37:44 -03:00
Gabriel Fontes 6fc5103fb0 refactor(hosts/merope/sabnzbd): migrate to new settings format 2026-08-10 10:35:58 -03:00
Gabriel Fontes 69c67d5377 fix(hosts/merope/sabnzbd): incrrease memory ceil 2026-08-10 10:09:33 -03:00
Gabriel Fontes 112735b62a fix(hosts/merope): tune sabnzbd to lower memory usage 2026-08-10 09:55:01 -03:00
Gabriel Fontes b1a569a2cc Revert "feat(hosts/merope/sabnzbd): revert connection limits, pause on pp"
This reverts commit 3425a71fa4.
2026-08-10 09:54:20 -03:00
Gabriel Fontes 654ea00bfd feat(grafana): add host network panels
Assisted-by: pi (gpt-5.6-sol)
2026-08-10 02:56:38 -03:00
Gabriel Fontes edfbd0f3a4 fix(hosts/merope/sabznbd): remove pause_on_post_processing 2026-08-10 02:41:58 -03:00
Gabriel Fontes 3425a71fa4 feat(hosts/merope/sabnzbd): revert connection limits, pause on pp 2026-08-10 02:25:04 -03:00
Gabriel Fontes d5c0787ba0 perf(merope/sabnzbd): negotiate ChaCha20 instead of AES
The Cortex-A72 in the BCM2711 implements no ARMv8 crypto extensions, so
TLS runs entirely in software. Measured on merope: AES-256-GCM manages
53 MB/s per core against 208 MB/s for ChaCha20-Poly1305, roughly 4x.

All six providers default to TLS_AES_256_GCM_SHA384 and all six accept
ChaCha20, so at the 43 MB/s this box was pulling, about 0.8 of a core was
going to decryption alone -- on a machine already sitting at 93% CPU with
the network only a third utilised and the disks coasting. Usenet
throughput here is bounded by the cipher, not by bandwidth or IO.

Setting ssl_ciphers makes SABnzbd cap the connection at TLS 1.2, since
Python never exposed SSL_CTX_set_ciphersuites() for the 1.3 suites. That
costs an extra handshake round trip, amortised across long-lived
connections, and an unencrypted certificate that SNI already gives away.
ECDHE preserves forward secrecy and ChaCha20-Poly1305 is the same AEAD
1.3 would have picked.

Preferred over exporting OPENSSL_CONF, which reaches the same cipher
while keeping TLS 1.3: this is the supported knob, so when upstream can
select 1.3 ciphersuites the cap lifts on its own, whereas overriding a
library's config file to reorder one list is the kind of thing that
breaks silently.

Assisted-by: pi (claude-opus-5)
2026-08-10 01:57:13 -03:00
Gabriel Fontes 532a35ba7a docs(todo): drop the merope reorg plan, it is done
/srv/media is now a single btrfs subvolume on the media disk holding the
libraries and both staging trees, so imports are same-filesystem renames.
426 torrents were re-pointed through the deluge UI and are seeding without
a recheck, and the M.2 went from 164G to 39G used.

The layout is described by hardware-configuration.nix, deluge.nix and
sabnzbd.nix better than prose could, so the plan has nothing left to say.

Two follow-ups it was carrying, recorded here rather than kept as a file:
copying across filesystems flattened every reflink between the music
library and the torrent payloads, so those trees hold 170 GiB where they
held ~124 and duperemove would reclaim it; and the media filesystem has
still never been scrubbed.

Assisted-by: pi (claude-opus-5)
2026-08-10 01:17:27 -03:00
Gabriel Fontes 517bde3aa7 feat(hosts/merope): update media mountpoints 2026-08-10 01:08:54 -03:00
Gabriel Fontes 4feb27b4f6 docs(todo): rewrite as status and actions
Both documents had accreted a running commentary -- findings, then
corrections to those findings, then corrections to the corrections. That
is a changelog, and it is the wrong shape for something read mid-migration
at 2am.

Rewritten to carry only current state and what remains to be done. The
boot-chain work, the swap incident, the USB 2.0 discovery and the
successive revisions of the throughput numbers are all gone; git holds
that history if anyone wants it.

The migration is now a runbook rather than a description: what can be done
in advance without downtime, what needs the media stack stopped and
roughly how long each step takes, and what must wait until the result is
proven.

Documents the reflink structure between music and torrents, measured
rather than assumed. Both trees cost ~124 GiB today and ~170 GiB once
copied, because reflinks cannot cross filesystems. Sharing is whole-file
and strictly bimodal -- no file is fragmentarily shared, and the 23% that
sit at 90-99% differ only by a ~115 KiB tag block Lidarr rewrote after
importing -- so duperemove recovers nearly all of it afterwards. Warns
against file-level duplicate finders, which compare content rather than
extents and would trade 564 seeds for zero bytes. Replaces a fabricated
claim that music was heavily hardlinked: it has none.

Drops host SSH keys from the backup set, where they were listed as tier 1
on the false premise that sops needs them. Every creation rule already
lists the GPG key as a recipient beside the per-host age keys.

Corrects the claim that alcyone needs no dumps: firefly and headscale are
both sqlite there, and only its postgres (roundcube) is excluded.

Assisted-by: pi (claude-opus-5)
2026-08-09 23:46:04 -03:00
Gabriel Fontes f58c76ac59 fix(global/greetd): drop stray backslash in tuigreet command
The escape came from tuigreet's shell-quoted README example. Nix needs
no escape here, so the backslash reached greetd.toml and its command
lexer rejected \$ as an unknown escape sequence -- greetd has failed to
start on every host without regreet since e4fa2194 (2026-06-16).

Assisted-by: pi (claude-opus-5)
2026-08-09 22:11:47 -03:00
Gabriel Fontes 095e5783ff fix(hosts/merope): set neededForBoot on /firmware 2026-08-09 21:57:35 -03:00
Gabriel Fontes c7173939ba feat(merope): manage the pi firmware partition declaratively
The firmware partition now lives on a microSD card instead of the M.2, and
nixos-hardware repopulates it on every switch.

Two reasons for moving it off the M.2. It sits inside the Argon case, so a
bad bootloader meant opening hardware to recover; on removable media that
becomes a card swap in any laptop. And the partition was 30M, which cannot
hold the GPU blobs, device trees and overlays the install script places.

Boot chain, for the record, since none of it is reproducible from this
flake: the EEPROM boots SD first (BOOT_ORDER=0xf41) and excludes the two
data drives by VID:PID, so the media disk can occupy a USB 3 port without
hanging the bootloader. Verified booting from the card on 2026-08-09 by
setting gpu_mem on the SD copy of config.txt and watching MemTotal drop
174 MiB -- the firmware exposes no boot-source to Linux, because U-Boot
rebuilds /chosen and discards it.

config.txt is now generated. Relative to the file it replaces it keeps
arm_64bit, enable_uart and disable_overscan, carries avoid_warnings over
explicitly, and picks up the nixos-hardware defaults -- including
arm_boost, which lifts this board (Pi 4B rev 1.4) from 1.5 to 1.8 GHz.

It drops enable_gic and armstub=armstub8-gic.bin. Both are vestigial on
current Pi 4 firmware, and the install script does not copy the armstub
binary, so declaring it would point config.txt at a file that is absent.

U-Boot is pinned to ubootRaspberryPi4_64bit rather than the module default
ubootRaspberryPiAarch64: it is the exact binary verified booting today,
when replacing U-Boot 2021.04 fixed a boot failure where the legacy
distro_bootcmd only ever tried USB device 0.

Assisted-by: pi (claude-opus-5)
2026-08-09 20:53:22 -03:00
Gabriel Fontes ae200e651e chore(flake): bump nixos-hardware for rpi firmware module
Adds raspberry-pi/common/firmware.nix (upstream 2026-07-10, cross-compile
fix 07-14), which installs the Pi firmware partition from the flake on
every switch instead of leaving it hand-populated.

Also drops raspberry-pi/4/cpu-revision.nix upstream. That overlay
hardcoded linux,revision = 0x00d03114; merope reports d03114 from the
firmware DTB regardless, so removing it changes nothing here.

Assisted-by: pi (claude-opus-5)
2026-08-09 20:41:58 -03:00
Gabriel Fontes b5e059f96b docs(merope): correct disk plans, record boot fix
Device letters on merope follow USB enumeration order and are not stable;
they changed three times on 2026-08-08/09 as drives were re-plugged. Both
documents now address disks by label throughout.

Corrections to the migration plan:

- The ~28 MiB/s attributed to the media disk was a saturated USB 2.0 link,
  not a seek-bound spindle. On USB 3 it sustains 183 MB/s, 6.5x faster.
  Sizing arguments were built on the wrong number.
- The 04:42 reset was a UAS device reset on the M.2 bridge (174c:2362),
  not swap: swap stayed flat at 2.27 GiB with 4.4 GiB available. The
  watchdog held it to 105s against 48min the previous day.
- Both drives now sit on the VL805 SuperSpeed side, so they share one
  PCIe lane rather than having independent paths.

Boot, resolved 2026-08-09 in two stages, both firmware-level and
therefore invisible to nixos-rebuild:

- EEPROM walks USB in port order and looped when the drive in 2-1 had no
  bootable partition. Excluded both data drives by VID:PID. Note
  'rpi-eeprom-config --apply' is unusable on NixOS, since the wrapper
  points FIRMWARE_ROOT at a nonexistent path; build the image with
  --config and stage pieeprom.upd/.sig by hand.
- U-Boot 2021.04 predates bootstd and declares USB as a single instance,
  so boot_targets held one usb0 and only devnum=0 was ever tried.
  Replaced with 2026.04, which enumerates every bootdev. Old binary kept
  as u-boot-rpi4.bin.bak.

Backups doc records that the M.2 has 2233 corruption errors and has never
been scrubbed, so they were found passively rather than by verification.
Music (92 GB, the only irreplaceable data there) has been copied to the
backups disk; a scrub is now the open item.

Assisted-by: pi (claude-opus-5)
2026-08-09 12:16:39 -03:00
Gabriel Fontes 3cfb0d440a docs: add backup plan
No backup tooling exists anywhere in the flake today, and sdc1 is a
932GB disk holding 5.9MB.

Covers what is actually irreplaceable -- firefly, radicale, deluge
state, mail, git, immich, music -- rather than the 4.6TB of re-acquirable
video, and specifies database dumps rather than live file copies, which
would otherwise produce backups that silently will not restore.

Mail and calendars are already replicated across three hosts, so they are
included for history rather than redundancy: sync propagates deletion,
and the useful protection there is retention depth, not another copy.

Assisted-by: pi (claude-opus-5)
2026-08-07 23:46:26 -03:00
Gabriel Fontes 031f2a4e0e docs(merope): add disk reorganization plan
Consolidates all media onto sdb in a single btrfs subvolume mounted at
/srv, so every import becomes a rename or hardlink rather than a
cross-device copy, and the disk holding the swapfile sees no media I/O.

Written up after the 2026-08-07 stall, whose root cause was swap
contending with a Radarr import on the same device.

Assisted-by: pi (claude-opus-5)
2026-08-07 23:29:19 -03:00
Gabriel Fontes 401c2ad12c feat(alcyone/grafana): add Swap to RAM Usage, add Disk IO panel
Fold back UI edits from the hosts dashboard:

- RAM Usage: rename the used-memory series to "Memory", add a "Swap"
  series (SwapTotal - SwapFree), and retarget the configFromData
  transformation from byFrameRefID to byType so Total Memory applies as
  max to both series. Show the legend, since there are now two series.
- Rename the Storage gauge to "Disk Usage".
- New "Disk IO" timeseries: rate of node_disk_io_time_weighted_seconds_total,
  joined against node_btrfs_info via label_replace to strip the partition
  suffix, so series are labelled by filesystem label.

The UI export predated d9a6c23e and would have reverted its Storage
query and threshold fixes; those hunks were dropped rather than folded.

Assisted-by: pi (claude-opus-5)
2026-08-07 23:27:55 -03:00
Gabriel Fontes d9a6c23e55 fix(alcyone/grafana): correct Storage gauge thresholds and queries
The top threshold step rendered a 100%-full filesystem in plain text
colour rather than red, so the alarm state was unreachable -- red only
covered 90-99.99%.

Both targets pulled a full range while groupingToMatrix keeps one value
per cell, so switch them to instant queries.

Join on (instance, uuid) rather than uuid alone; with uuid-only matching,
a multi-value $hosts could cross-match filesystems between hosts.

Assisted-by: pi (claude-opus-5)
2026-08-07 21:48:20 -03:00
Gabriel Fontes e5e1048a99 fix(merope): replace Nice with cgroup weights, switch to BFQ
The 2026-08-07 stall presented as a CPU problem but was I/O underneath:
a Radarr cross-disk import saturated the USB SSD holding both the rootfs
and the swapfile, and everything else queued behind it.

The existing Nice values were aimed at the wrong thing twice over. They
only ever addressed CPU scheduling, which was the symptom -- renicing a
process blocked in D-state achieves nothing. They were also a layer too
low: with the cgroup v2 cpu controller enabled, CPU is split between
service cgroups by weight, and every service on this host sat at an
identical 100. Nice only reorders tasks within a cgroup, so a lone
service being polite to itself changed nothing.

Replace them with CPUWeight/IOWeight, which is the layer that actually
arbitrates between services. Nice and IOSchedulingPriority are dropped
rather than kept alongside: nothing here escapes the cpu controller, and
ioprio depends on BFQ exactly as IOWeight does, so it is not a fallback
for anything -- if BFQ is absent both are inert together.

deluged is included despite never having had a Nice; it writes to the
same device continuously and was the other half of the load that day.
recyclarr loses its Nice without replacement -- it only makes a handful
of API calls to the *arrs and never contends for anything.

Requires BFQ. All three disks were on mq-deadline, which has no notion of
I/O weights at all and would have made IOWeight a silent no-op.

Assisted-by: pi (claude-opus-5)
2026-08-07 21:00:23 -03:00
Gabriel Fontes 6338b93a5d feat(home/hyprland): invert focus_on_activate
Almost everything that requests activation is being rude about it, and with
follow_mouse on it turns into a focus fight. Default to off and opt browsers
back in, so opening a link from another app still raises the browser.

Makes the LinOffice focus rule redundant; the maximize suppression stays,
since that one is Excel being Excel rather than a focus policy.

Assisted-by: pi (claude-opus-5)
2026-08-07 20:43:09 -03:00
Gabriel Fontes 09b4856163 feat(home/hyprland): tame LinOffice RemoteApp windows
FreeRDP RemoteApp windows mirror the Windows-side focus state, so Office
requests activation constantly. With focus_on_activate and follow_mouse both
on, that ping-pongs: 22 unprompted focus flips in 30s between Excel and the
terminal under the cursor, which also made clicks land on a window that was
mid-flip. Each activation carries a maximize request too, which read as the
window spontaneously fullscreening whenever it regained focus.

Assisted-by: pi (claude-opus-5)
2026-08-07 20:39:43 -03:00
Gabriel Fontes e5ae4001e3 fix(merope): bound stalls and stop swapping onto the contended disk
merope hung for ~48min (16:59-17:56 on 2026-08-07) with all four cores
pinned. No OOM, no panic, no thermal event -- it simply stopped making
progress and needed a manual power cycle.

Root cause: /swap/swapfile lives on sda, the same USB SSD as the rootfs.
swappiness=60 had ratcheted ~4.2G of cold anonymous pages onto it over
days (monotonically -- it never came back). A torrent write plus a Radarr
cross-disk import then saturated that device at ~85MiB/s, so page-ins
queued behind bulk I/O indefinitely. Nothing exceeded a memory limit, so
the kernel OOM killer never engaged.

All four USB ports share one VL805 controller on a single PCIe lane, so
relocating swap to another disk would not have given it an independent
path.

- watchdog: bound any future stall to a reboot instead of a silent hang
- ondemand: merope never exceeded 600MHz of its 1500MHz in 4h of 100% load
- swappiness=10: MemAvailable never fell below 3.6G, swap is not
  load-bearing here; keep the swapfile as a backstop, not a habit
- psi=1 + earlyoom: the kernel was not even measuring stall time

Assisted-by: pi (claude-opus-5)
2026-08-07 18:23:09 -03:00
Gabriel Fontes 264ce2d6f3 feat(home/productivity): add mgc account 2026-08-07 14:36:42 -03:00
Gabriel Fontes c76aaec68f refactor(home/productivity): make accounts opt-in 2026-08-07 14:30:49 -03:00
Gabriel Fontes ec52586ed2 fix(home/todoman): fallback to null if no todo supporting calendar present 2026-08-07 11:35:34 -03:00
Gabriel Fontes 97ec061da1 feat(home/mail): don't gpg sign by default, remove gpg key from signature 2026-08-07 11:27:15 -03:00
Gabriel Fontes c6d8944b03 chore(home): get rid of syncthing 2026-08-07 11:26:26 -03:00
Gabriel Fontes 2743828f22 chore(home/waybar): remove unused modules 2026-08-07 11:25:26 -03:00
Gabriel Fontes 16b2eb0241 feat(home/waybar): improve ubuntu logo 2026-08-07 11:22:39 -03:00
Gabriel Fontes bc0eabb66c fix(home/hyprland/hypridle): add floor to brightness
Required for intel panels, as their 0 is truly 0
2026-08-07 11:14:43 -03:00
Gabriel Fontes 5091348ab9 feat(hosts/mgc): install wireguard-tools
Used for systemctl enable wg-quick@wg0
2026-08-07 07:54:03 -03:00
Gabriel Fontes 1bfb3c687d fix(jagex-auth): use wrapped package name 2026-08-07 02:22:19 -03:00
Gabriel Fontes 400bc2021b fix(home/ai): gate runelite-mcp behind runelite package 2026-08-07 02:16:30 -03:00
Gabriel Fontes 52c180d4ae feat(home/pi): bump opus and sonnet to 5 2026-08-07 02:12:34 -03:00
Gabriel Fontes 18e1db5b05 chore(hosts/sm): disable hydra autoupgrade for now 2026-08-07 01:55:39 -03:00
Gabriel Fontes e41292b51d feat(home/mgc): add basic mgc clis 2026-08-07 01:54:26 -03:00
Gabriel Fontes d42a4fb8a2 fix(home): get rid of signing by default 2026-08-07 01:43:07 -03:00
Gabriel Fontes 3ad46d1523 refactor(system-manager): extract unix_chkpwd wrapper into a module
The setuid /run/wrappers/bin/unix_chkpwd wrapper is generic plumbing that
nixpkgs' pam_unix requires (system-manager, unlike NixOS, doesn't provide
it), not host policy. Move it to modules/system-manager/unix-chkpwd.nix,
applied unconditionally like NixOS does; hosts/.../pam.nix keeps only the
pam.d stacks.

Assisted-by: pi (claude-opus-4-8)
2026-08-07 01:14:11 -03:00
Gabriel Fontes 7aac214925 refactor(system-manager): add nix.registry module, use it in nix.nix
Port nixpkgs' nix.registry option (config/nix-flakes.nix) into
modules/system-manager/nix-registry.nix, giving system-manager the same
interface NixOS has. common/global/nix.nix now just sets
'nix.registry = mapAttrs (_: flake: {inherit flake;}) flakeInputs' like
the NixOS side, instead of hand-writing /etc/nix/registry.json.

Assisted-by: pi (claude-opus-4-8)
2026-08-07 01:13:56 -03:00