Commit Graph
100 Commits
Author SHA1 Message Date
Ryan Yin 524770b351 security(shoukei): disable prometheus exporters 2026-10-03 17:21:37 +08:00
Ryan Yin 0d2665c286 docs(security): drop abandoned kernel-status reporter plan
The optional kernel reboot-visibility change was closed without merging, so remove the planned-reporter wording. Replace it with the manual booted-vs-selected kernel check and update the P1 TODO accordingly.
2026-10-03 16:40:01 +08:00
ryan4yin | 二花 01e93c2b65 Merge pull request #363 from ryan4yin/fix/smartctl-exporter-describe-descriptors
chore(workarounds): add a registry; pin smartctl_exporter to the #329 fix
2026-10-03 13:13:36 +08:00
Ryan Yin 0a8fb5cf01 docs(workarounds): clarify removal and recovery conditions 2026-10-03 13:12:31 +08:00
Ryan Yin 7fe63a4719 docs: fix the muvm workaround entry reasoning
muvm is disabled because it does not build/run on nixos-apple-silicon yet, not because of a permanent hardware limitation; the 16k page size is the reason it is wanted, and the removal condition is muvm building and working.
2026-10-03 12:59:45 +08:00
Ryan Yin 39d351ade2 docs: group the workaround registry by type
Split the single table into Pins / Workarounds / Known issues / WIP sections so the registry is readable by section instead of scanning a Type column.
2026-10-03 12:56:31 +08:00
Ryan Yin e975f69383 docs: add a workaround registry with removal conditions
WORKAROUNDS.md collects temporary workarounds, version pins, carried patches, and known gaps, each with a removal condition, so they can be re-evaluated and rolled back on a schedule. AGENTS.md points to it and states the convention: a change that adds a workaround adds a row in the same PR.
2026-10-03 12:53:30 +08:00
Ryan Yin 0a847c1f55 refactor(overlays): pin smartctl_exporter to the upstream #329 commit
Replace the backported patch with a src/version/vendorHash override that pins prometheus-smartctl-exporter to upstream 6274decc (2026-09-28), which already carries the Describe() fix from PR #329. Simpler to maintain than a patch file and it tracks the upstream change directly; drop the overlay once smartctl_exporter 0.15.0 is packaged in nixpkgs.
2026-10-03 12:53:30 +08:00
Ryan Yin e8764b802a fix(overlays): backport smartctl_exporter Describe fix (upstream #329)
smartctl_exporter 0.14.0 derives Describe() from the devices it can read at startup. A device that only becomes readable later (an NVMe whose ACL arrives late, or an HDD waking from standby) then makes Collect() emit metrics with unregistered descriptors, so /metrics returns HTTP 500 and the whole scrape fails, hiding even the healthy disks.

Backport upstream PR #329, which makes Describe() send the full explicit descriptor set. Carry it as an overlay until smartctl_exporter 0.15.0 is released and packaged in nixpkgs.

Refs: https://github.com/prometheus-community/smartctl_exporter/pull/329
2026-10-03 12:49:36 +08:00
Ryan Yin d9208f492b fix(preservation): keep logrotate state in a persisted directory 2026-10-03 09:42:14 +08:00
Ryan Yin efdf153f0a fix(shoukei): stop latched nscd failures on resolvconf restarts 2026-10-03 09:42:13 +08:00
Ryan Yin a1ec97d3a2 refactor(bwraps): source wechat from nixpkgs-master and reuse its AppImage
Reuse the already-extracted, libtiff-patched AppImage from the nixpkgs wechat package (`wechat.src`) instead of keeping our own CDN URLs and hashes, which had to be refreshed whenever Tencent replaced the versionless files. Take the package from nixpkgs-master, which carries the newest builds.
2026-10-03 00:14:00 +08:00
Ryan Yin d27818e948 docs: update stale workaround comments
- wechat.nix: repacking is needed because nixpkgs' wechat package does not expose its AppImage wrapper args for `.override`, not because wrapAppImage lacks overriding (it forwards args to buildFHSEnv).
- peripherals.nix: drop a link to an already-closed issue and fix a typo.
2026-10-03 00:14:00 +08:00
Ryan Yin 6e33a28609 chore(blender): pin nixpkgs-blender and drop obsolete OIDN override
nixpkgs-blender tracked the nixpkgs master branch, so every `just up` re-bumped it and started a full Blender/CUDA source rebuild even though Blender stayed at 5.2.2 LTS. Pin it to a fixed rev so bumps are deliberate.

The OIDN cmake override is obsolete: nixpkgs#545542 made setupCudaHook add nvcc to CUDAToolkit_ROOT, fixing the CMake 4.3+ split-root failure (nixpkgs#544701). Dropping it also stops Blender's derivation from depending on nixpkgs-stable.
2026-10-03 00:14:00 +08:00
Ryan Yin facf33615e fix(nixos): install terminfo only for terminals in use
environment.enableAllTerminfo installs every terminal's terminfo, including rxvt-unicode, which no longer builds with GCC 16 (NixOS/nixpkgs#568896). Install just the terminals we use (alacritty, foot, ghostty, kitty) instead. This also makes the aarch64 jasper workaround unnecessary.
2026-10-03 00:14:00 +08:00
Ryan Yin 8b13ab2ae2 feat(tools): add tuios terminal multiplexer 2026-10-03 00:14:00 +08:00
Ryan Yin c2a5f6643a flake.lock: Update
16 inputs moved; nixpkgs -> c59305bab206 (nixos-unstable, 2026-10-01), plus the
master/stable/darwin/blender/patched nixpkgs inputs and the module flakes
(home-manager, microvm, nixos-apple-silicon, nix-gaming, nixpak, llm-agents,
rust-overlay, flake-parts, git-hooks, nu_scripts).

Audited each moved revision through the GitHub compare API: no red flags
(substituters, trusted-users, activationScript, pre-commit hooks) in the inputs
examined.  home-manager carries the rl-2611 extraConfig/mkForce change (affects
mbsync/lieer/mujmap/notmuch/astroid/grobi; none used here).  The home-manager
compare is large, so the audit is not exhaustive and relies on the build.

Validated with `just test` (true), eval-host on the NixOS hosts, and
`just build-host ai-niri`; deployment passed.  The build initially failed on
rxvt-unicode-unwrapped (GCC 16 std::lerp regression, nixpkgs#568896), pulled in
by environment.enableAllTerminfo; terminfo is now scoped to the terminals in use.
2026-10-03 00:14:00 +08:00
Ryan Yin a26ab3be63 chore(disko): grow swapfile from 20G to 96G
Running strata with qwen3.8-flash-next keeps ~53G of model weights
resident, leaving little RAM for the desktop side and pushing ~13G of
anonymous pages into the 20G swapfile. With swap that full, a burst
risks OOM-killing processes. Disk space is not a constraint (1.9T
btrfs, ~1.4T free), so grow the swapfile to the classic 1x-RAM size.

Keep zram off and zswap at 10%: zram's compressed pool would steal page
cache that the mmap'd weights rely on.
2026-10-02 19:45:08 +08:00
Ryan Yin 54aacd12d5 docs(nixpkgs-review): add closure-size review guidance
Prefer the narrowest output of a dependency (for example stdenv.cc.cc.lib
instead of stdenv.cc.cc) and measure the built closure, since a full
toolchain can add hundreds of MiB. Also note how to check what is actually
needed (DT_NEEDED, exec'd tools) before trimming.
2026-10-02 17:11:31 +08:00
Ryan Yin 6a026ecf9f chore(desktop): make podman rootless-only
Disable the rootful system podman.socket on desktop hosts and drop the module's autoPrune, which prunes the rootful store and pulls in the rootful API service. Add a weekly per-user timer that prunes the rootless store instead.
2026-10-02 15:58:12 +08:00
Ryan Yin ef61c458e6 chore(go-musicfox): declare config.toml and reset it on rebuild
Manage ~/.config/go-musicfox/config.toml declaratively: the upstream default plus the mpv engine, ~/Music download dir, 2 GiB cache and cover art.

The app rewrites the file with a temp file plus rename, which would replace a plain symlink, so use force = true like fcitx5's profile: the repo copy is restored on every rebuild and runtime edits are ephemeral. Runtime data and state stay on the persistent volume.
2026-10-02 14:39:19 +08:00
Ryan Yin 25f059a49b chore: add go-musicfox 2026-10-02 14:12:05 +08:00
Ryan Yin a4206c17a9 docs(agents): note nushell is the interactive shell 2026-10-02 11:39:36 +08:00
Ryan Yin 1d43fd2802 docs(agents): label the post-merge cleanup rule 2026-10-02 11:24:18 +08:00
Ryan Yin 044862110e docs(agents): clean up after a merged PR 2026-10-02 11:21:19 +08:00
Ryan Yin 1f8db1fccf fix(catppuccin): drop the ignored user-level cache entry
Catppuccin's home-manager module writes extra-substituters/extra-trusted-public-keys
for catppuccin.cachix.org into the user-level ~/.config/nix/nix.conf. Since the
normal user is no longer a trusted-user (modules/base/nix.nix), Nix ignores those
client-specified settings and warns on every command. The ports build locally, so
turn the user-level cache off instead.
2026-10-01 21:25:55 +08:00
Ryan Yin 14db49660b chore(preservation): drop persist entries for removed apps 2026-10-01 20:10:08 +08:00
Ryan Yin a6553b25a5 chore: drop archived terraformer and unused netbird 2026-10-01 20:10:07 +08:00
Ryan Yin 1546e54bb2 chore(noctalia): move OSD and notifications to the bottom-right 2026-10-01 14:09:16 +08:00
Ryan Yin 872901007e docs(agents): use terraform plan, drop nonexistent helm diff 2026-10-01 11:34:34 +08:00
Ryan Yin ea73c716e8 flake.lock: Update
Flake lock file updates:

• Updated input 'mysecrets':
    'git+ssh://git@github.com/ryan4yin/nix-secrets.git?ref=refs/heads/main&rev=6daee5c0fa300bfcd13d702ae1d69aeb0a4c281d&shallow=1' (2026-09-28)
  → 'git+ssh://git@github.com/ryan4yin/nix-secrets.git?ref=refs/heads/main&rev=decf57110a6ecbd45b3ab7ac5ec7db393f17d3a7&shallow=1' (2026-10-01)
2026-10-01 10:53:08 +08:00
Ryan Yin 9885283edf docs(agents): clarify local language selection and prefer Bun 2026-10-01 10:23:35 +08:00
Ryan Yin 01ed0aa52f chore(agents): upgrade to opencode v2 2026-10-01 09:39:05 +08:00
Ryan Yin 7f6759219b docs(agents): align evals with external instruction boundaries 2026-09-30 21:17:19 +08:00
Ryan Yin 91cc9c0cf4 docs(agents): fix authorization and skill trust wording
Allow clearly-implied task authorization, trust skills listed in the runtime's configured catalog, and restore the ban on following external-material instructions. Sync the affected evaluation scenarios.
2026-09-30 21:09:34 +08:00
Ryan Yin bae98ed1c8 docs(agents): allow TypeScript for complex shell commands 2026-09-30 18:38:08 +08:00
Ryan Yin e10f0d6794 flake.lock: Update
Flake lock file updates:

• Updated input 'llm-agents':
    'github:numtide/llm-agents.nix/03aa73a454d7468e0a3d44faee511fa6ae7c7ded?narHash=sha256-DjGLaiqnHlHQ9d8EfKhklMlCRoEC97FkI9XRgznopL8%3D' (2026-09-26)
  → 'github:numtide/llm-agents.nix/af40d966859ec4075ecc172dbb39e53f474dc5d9?narHash=sha256-I4O5GSbZgmvzV7dj8fZN8furV2UdEpahh4rvsZOfs/Q%3D' (2026-09-30)
• Updated input 'llm-agents/nixpkgs':
    'github:NixOS/nixpkgs/d54020a6ac3211e9f4201631bdf67678818c0cdf?narHash=sha256-StRyS/lFHtIw/UgJk%2Bxo%2BHA66mtoWeDUbkJdvf2Byn4%3D' (2026-09-26)
  → 'github:NixOS/nixpkgs/f45c6f04c2f013f004bf94e284e95d72898d9393?narHash=sha256-6k3n7X2UsZ6tAlWTz99RimiZab%2B17tMUrw9sRUcELiA%3D' (2026-09-28)
2026-09-30 16:12:45 +08:00
Ryan Yin c7d8db2bf3 fix(k8s): rebalance k3s-test-1 VMs after the youko/shushou swap 2026-09-29 21:46:09 +08:00
Ryan Yin 2e5f539a47 fix(hosts): move UPS/nut metrics to youko after the swap 2026-09-29 21:36:47 +08:00
Ryan Yin 2be0337979 docs(hosts): record the youko/shushou swap and its rationale 2026-09-29 21:36:47 +08:00
Ryan Yin 2401727315 flake.lock: Update
Flake lock file updates:

• Updated input 'mysecrets':
    'git+ssh://git@github.com/ryan4yin/nix-secrets.git?ref=refs/heads/main&rev=b41ddcfa4537cfb56d1e0f0df0198a2e90fee180&shallow=1' (2026-09-25)
  → 'git+ssh://git@github.com/ryan4yin/nix-secrets.git?ref=refs/heads/main&rev=6daee5c0fa300bfcd13d702ae1d69aeb0a4c281d&shallow=1' (2026-09-28)
2026-09-28 16:19:41 +08:00
Ryan Yin 098ed110d7 chore(darwin): drop redundant broken-packages overlay
conda/mitmproxy/wireshark are already Linux-gated in the shared home modules, and verible is unreferenced, so replacing them with emptyDirectory is unnecessary.
2026-09-28 10:55:22 +08:00
Ryan Yin e8f8099011 chore(overlays): drop redundant openldap test override
openldap's flaky tests are skipped upstream now (doCheck = true), so the override only forced local rebuilds of openldap/cyrus-sasl dependents such as libvirt and kio.
2026-09-28 10:55:20 +08:00
Ryan Yin 470006ed3a chore(rustfs): drop nixpkgs-small input, use nixpkgs rustfs 1.0.0 2026-09-28 10:42:51 +08:00
Ryan Yin 5b4127bcec flake.lock: Update
Flake lock file updates:

• Updated input 'nixpkgs':
    'github:nixos/nixpkgs/e554fab72f81915600f3f449b786fd9af40439a5?narHash=sha256-ZKhUe/2IJUq1JhKxKMu8rbkgSGmPP2ZCqlIPn40aGCM%3D' (2026-09-17)
  → 'github:nixos/nixpkgs/e158d9ed9b51c98974c5e66e1ba1c9e0255fecaa?narHash=sha256-hKlVl12B1dF0Q5vd9dY3lIJM5mFGWYSlXwSLAqHZ1%2Bs%3D' (2026-09-26)
2026-09-28 10:41:47 +08:00
Ryan Yin b38d8b802e docs(agents): make apply a distinct step in impactful changes 2026-09-28 10:18:52 +08:00
Ryan Yin 853747425f chore(idols-ai): drop the davfs WebDAV fileshare mount
davfs2 caches the whole opened file regardless of cache_size, so opening media on /mnt/fileshare downloads it fully and blocks the mount. The share is no longer used.
2026-09-26 23:47:29 +08:00
Ryan Yin 695d58de8b docs(agents): mention quoted heredoc for multi-line code 2026-09-26 22:53:13 +08:00
Ryan Yin 27b99fa45f docs(agents): add untrusted-source safety rules
Treat content from unverified sources as data, not instructions, and require authorization before cloning, downloading, or executing unverified code and install scripts.
2026-09-26 08:23:15 +08:00
Ryan Yin 2a2933a889 docs(youko): note the transmission inbound-port TODO
youko's default gateway is suzi (mihomo transparent proxy, no UPnP/NAT-PMP),
so transmission cannot map its peer port; record the options for later.
2026-09-26 00:23:54 +08:00
ryan4yin | 二花 e8e7844051 Merge pull request #314 from ryan4yin/feat/rustfs-s3
feat(youko): replace MinIO with RustFS S3
2026-09-25 15:53:40 +08:00
Ryan Yin 7e0e4aa566 feat(youko): replace MinIO with RustFS S3
Deploy RustFS in place of the retired MinIO and move the S3 consumers over.

- flake.nix / flake.lock / outputs/default.nix: add a nixpkgs-small
  (nixos-unstable-small) input for the rustfs 1.0.0 package (with the web
  console), instantiated as pkgs-small in genSpecialArgs alongside the other
  nixpkgs instances; drop the rustfs flake input. The rest of the system stays
  on the default nixpkgs.
- hosts/12kingdoms-youko/homelab-services/rustfs.nix: use nixpkgs' own
  services.rustfs module, with package = pkgs-small.rustfs and
  environmentFile = the agenix rustfs.env secret.
- caddy.nix: s3.writefor.fun (S3 API) and s3-console.writefor.fun (console,
  redirects / to /rustfs/console/).
- secrets/nixos.nix: declare a single rustfs.env (dotenv) secret holding
  RUSTFS_ACCESS_KEY / RUSTFS_SECRET_KEY, replacing the separate key files.
- infra/minio -> infra/rustfs: buckets are managed with the hashicorp/aws
  provider against the RustFS S3 endpoint; IAM/ILM are applied with rc.
2026-09-25 15:23:50 +08:00
Ryan Yin e401a75ca5 chore(agents): remove crush
Crush hardcodes banned bash commands, blocking many operations. Drop the package, its AGENTS.md/CRUSH.md install target, env vars, and preservation entries.
2026-09-25 00:30:12 +08:00
Ryan Yin 310d59b437 flake.lock: Update
Flake lock file updates:

• Updated input 'mysecrets':
    'git+ssh://git@github.com/ryan4yin/nix-secrets.git?ref=refs/heads/main&rev=8533d18ee50e6e5cddd3cd3decfa6ac54f116472&shallow=1' (2026-09-23)
  → 'git+ssh://git@github.com/ryan4yin/nix-secrets.git?ref=refs/heads/main&rev=7e75aad771e8748f666a83832678f3fbb6378a73&shallow=1' (2026-09-24)
2026-09-25 00:30:12 +08:00
ryan4yin | 二花 c3a8d99ceb Merge pull request #313 from ryan4yin/fix/k3s-test-1-master-config-cleanup
fix(k3s): drop Home Manager from test masters
2026-09-24 14:12:04 +08:00
Ryan Yin 9a6923b4e9 fix(k3s): drop Home Manager from test masters
Keep the six node configuration intact while removing the failing user activation from the three control-plane MicroVMs. Update the regression test and current K3s configuration notes.
2026-09-24 13:35:33 +08:00
ryan4yin | 二花 f5f4531fcb Merge pull request #312 from ryan4yin/fix/k3s-test-1-guest-dns
fix(k3s): stabilize guest networking and control-plane metrics
2026-09-24 11:36:41 +08:00
ryan4yin | 二花 882383f754 Merge pull request #309 from ryan4yin/fix/k3s-test-1-stable-ipv6
fix(k3s): disable temporary IPv6 addresses in test VMs
2026-09-24 11:29:23 +08:00
Ryan Yin c752703488 docs(network): explain DHCPv6 DNS overrides 2026-09-24 10:43:49 +08:00
Ryan Yin 688a244ae0 fix(k3s): ignore advertised DNS on test VMs 2026-09-23 23:44:13 +08:00
Ryan Yin f357569d32 fix(k3s): disable IPv6 privacy on guest NICs 2026-09-23 23:05:53 +08:00
Ryan Yin fa0743a28b fix(k3s): disable temporary IPv6 addresses in test VMs 2026-09-23 22:28:35 +08:00
Ryan Yin d1dd35bd7c chore(codex): bump the override to 0.156.1
0.156.1 still lacks the codex-chatgpt recursion_limit attribute, so keep the postPatch that adds it. The vendored Cargo.lock is unchanged, so the cargoHash stays the same.
2026-09-23 12:07:28 +08:00
Ryan Yin 55aa4e3e10 fix(k8s): link the CNI dirs on the k3s agent nodes
cilium writes /etc/cni/net.d while istio-cni reads k3s's own dir, so on the new workers the chained plugin never found a network config. Add the symlinks the server module already has.
2026-09-23 12:07:28 +08:00
Ryan Yin 64cad91401 fix(k8s): unblock the k3s-test-1 workers
kubelet refuses to self-assign the reserved node-role.kubernetes.io/* labels, so the worker --node-label made the agent crash-loop. Drop it and rely on the masters' control-plane taint for placement; document that the taint only lands via registerWithTaints on first registration, so it was applied by hand here.
2026-09-23 12:07:28 +08:00
Ryan Yin a3efb42202 chore(k8s): update secrets 2026-09-23 12:07:28 +08:00
Ryan Yin a2604a0c32 chore(codex): override to 0.156.0 pending llm-agents bump 2026-09-23 10:37:52 +08:00
Ryan Yin f6e331dbf7 flake.lock: Update
Flake lock file updates:

• Updated input 'llm-agents':
    'github:numtide/llm-agents.nix/34081a176242cbccd62f19978f32abfff933813f?narHash=sha256-5QvQZFsM/xcZRVUGuv56QU3d0RQZcqR9axikxGf1KLE%3D' (2026-09-19)
  → 'github:numtide/llm-agents.nix/fcf80443a6e5363f30dc9b191bcb65cfcd788df2?narHash=sha256-uWgg4A%2BhrlViz1L0y9D8zMkIjQU8UzJqoyxaZ3xY24Q%3D' (2026-09-23)
• Updated input 'llm-agents/bun2nix':
    'github:Mic92/bun2nix/5765b0614591f75ee8ba5596e81ae85c167d1071?narHash=sha256-mEq2kU%2BljompTToZ44Afvm7d/rHJ5iMBl0tjZuyShJs%3D' (2026-08-29)
  → 'github:Mic92/bun2nix/07a5bfc8ac36c5370199343fa620b69f63186e33?narHash=sha256-1/SLBjSYBzDdDhvLQ83wrzBakyS/xNGgtxHGNuveOEQ%3D' (2026-09-21)
• Updated input 'llm-agents/nixpkgs':
    'github:NixOS/nixpkgs/c7def046b9a883d46974757852106483d741586f?narHash=sha256-6RSEDHIWQtesQKWSu5qRai8L2h4KgCgMEfJHstW99G4%3D' (2026-09-14)
  → 'github:NixOS/nixpkgs/b6c98e9e6633ee64753b594ff4a5febf0367fc00?narHash=sha256-QpXotokGh5eeMG1Njiuh27oP0rK6t5%2BcMp7ymXSs7mc%3D' (2026-09-22)
2026-09-23 09:50:10 +08:00
ryan4yin | 二花 5d0055b024 Merge pull request #277 from ryan4yin/feat/cua-headless-sway
feat(computer-use): headless X11/i3 + cua-driver on ruby and kana
2026-09-21 21:43:45 +08:00
Ryan Yin 0185fd0f85 docs(computer-use): document the headless i3 session 2026-09-21 21:31:27 +08:00
Ryan Yin 00aab5f562 feat(computer-use): add a headless X11/i3 environment
Give the idols-ruby and idols-kana VMs a headless computer-use
environment: Xvfb plus i3, driven by cua-driver (and computer-use-linux
as a fallback). Includes the system module (AT-SPI, fonts, Mesa, Clash
Verge proxy, proxy-region timezone), the home i3 module (Xvfb/i3/x11vnc
services, browser flags), host wiring and an eval test.
2026-09-21 21:31:27 +08:00
Ryan Yin 90761a6b73 feat(computer-use): package computer-use-linux and cua-driver
Package the prebuilt releases (computer-use-linux v0.7.1 and
cua-driver-rs v0.24.0) under pkgs/, injected through thin callPackage
overlays so they are easy to relocate to the NUR repository later.
2026-09-21 21:31:27 +08:00
Ryan Yin 37f29154d1 docs(backup): record what the metrics actually expose
rest-server only ships the go/promhttp defaults, so repository growth is
charted from node-exporter's filesystem metrics instead.
2026-09-21 20:57:41 +08:00
Ryan Yin 842cd26f64 feat(monitoring): scrape the restic rest-server
Expose /metrics on the loopback-bound server, scrape it with
victoriametrics, and block /metrics on the public vhost.
2026-09-21 20:56:01 +08:00
Ryan Yin 1cbb52add1 docs(secrets): desktops and recovery_key have identical access
recovery_key is a member of desktop_keys, so every group written as
desktop_keys ++ ... covers both.
2026-09-21 20:51:13 +08:00
Ryan Yin 89e57b5b39 docs(secrets): state that every secret must be decryptable by the desktops
The desktops hold the trusted admin keys and are where secrets are edited and
rekeyed from; narrowing a set to the servers alone breaks agenix -r and drops
the offline recovery key.
2026-09-21 20:50:11 +08:00
Ryan Yin a43aa02a69 docs(secrets): state the recipient invariant
A recipient set must answer two questions: who may read it, and how it is
recovered once those hosts are gone. Dropping recovery_key while narrowing
a secret is easy and silent.
2026-09-21 20:45:47 +08:00
Ryan Yin 8a44c23d74 docs(backup): say 'cloud copy' rather than 'offsite'
Clearer for a reader who does not live in backup jargon; the requirement
(not in the homelab, immutable) is spelled out in the text.
2026-09-21 20:44:56 +08:00
Ryan Yin 096607a5c5 feat(backup): notify on failure, and 404 unconfigured hostnames
A failed backup was silent. Post to alertmanager (which routes above-info
to telegram), and have caddy answer 404 instead of its empty 200 for
*.writefor.fun names that are not services.
2026-09-21 20:42:39 +08:00
Ryan Yin c3f0dbf8bd revert(backup): drop append-only for the desktop endpoint
A desktop holds both the plaintext and the repository password, so blocking
deletion on the server protects little while preventing the automatic
retention the client needs. Immutability belongs in the offsite copy.
2026-09-21 20:38:08 +08:00
Ryan Yin 5a017666f6 refactor(backup): name the REST endpoint restic.writefor.fun
'backup' did not say what the service is.
2026-09-21 20:38:08 +08:00
Ryan Yin d322f4d2b6 docs: add BACKUP.md, and stagger the restic schedule per host
The design (layers, password groups, retention, restore steps) was only in
code comments. Also make the timer configurable: a whole hour of random
delay defeated any staggering, and the desktop's push, youko's own run and
btrbk all otherwise contend for the same disks.
2026-09-21 20:38:08 +08:00
Ryan Yin 2ff93c16ce feat(restic): move idols-ai's off-host backup to the REST server
Split the repository password into desktop and homelab groups, add the
environmentFile/pruneOpts module options, and point the desktop at youko's
REST endpoint.
2026-09-21 20:38:08 +08:00
Ryan Yin 1e2cef2550 feat(youko): serve restic backups over an append-only REST server
Run restic-rest-server behind caddy (append-only, private repos, htpasswd
from agenix) and register youko's host key centrally.
2026-09-21 20:38:08 +08:00
Ryan Yin 12ac5f45aa feat(idols-ai): restic backup to a local repository
Allowlist of the irreplaceable directories (Documents, work, Pictures,
nix-config, .local/state); project checkouts under ~/codes live in git and
are not backed up. Kept the excludes generic, since this repo is public.

Also move the restic-password secret to a desktop.enable || server.storage
gate so desktops get it without enabling a server group.
2026-09-21 19:04:58 +08:00
ryan4yin | 二花 9ef7ba7112 Merge pull request #297 from ryan4yin/feat/app-data-to-ssd
feat(youko): move the service data from the HDD to the SSD
2026-09-21 18:00:10 +08:00
Ryan Yin a755b6fa11 feat(youko): move the service data from the HDD to the SSD
The services now run directly on the host, so their state does not belong
on the HDD behind the flaky USB-SATA bridge: /data/apps was small-file
heavy and latency/consistency sensitive. Point every dataDir at
/persistent/apps (the LUKS nvme) instead.

The HDD keeps the bulk data that suits it: /data/fileshare (173G) and
/data/backups (24G). The HDD's old @apps subvolume and its data are left
in place for now.
2026-09-21 17:56:35 +08:00
ryan4yin | 二花 12966d326c Merge pull request #296 from ryan4yin/fix/usb-hdd-mitigations
fix(youko): mitigate the flaky USB-SATA HDD bridge
2026-09-21 17:56:08 +08:00
Ryan Yin 5bbe17ebcd fix(youko): also try disabling the WD idle3 (Intellipark) timer
-B 255 turns APM off and it stuck, but the disks still reach standby, so
the bridge firmware is likely doing the spindown. -J 0 additionally asks
the drive to stop parking its heads (sdb has ~1M load cycles).
2026-09-21 17:43:05 +08:00
Ryan Yin 899162055a fix(youko): drop pcie_aspm=off, re-assert the hdparm settings hourly
pcie_aspm=off was the least-justified mitigation (the flakiness is on the
USB/SATA side) and costs power. Also log the disks' APM level/state and
re-apply the settings hourly, since the bridge or the disk firmware can
drop them (the disks were still reaching standby).
2026-09-21 17:42:21 +08:00
Ryan Yin 45a35a080d fix(youko): address the HDDs by-id, not /dev/sdX
Follows the disko config (ata-WDC_...-<serial>); the sdX names are not
stable.
2026-09-21 17:38:54 +08:00
Ryan Yin ce1645619f fix(youko): mitigate the flaky USB-SATA HDD bridge
The two 4TB HDDs sit behind a JMicron JMS567 that resets and throws
UDMA-CRC / I/O errors (the disks themselves are healthy). Best-effort
mitigations while the enclosure stays in use:

- kernel: usbcore.autosuspend=-1, usb-storage.delay_use=10, pcie_aspm=off
- udev: keep the bridge's power/control=on (never autosuspend)
- disable APM/standby on the HDDs (spindown is a common reset trigger)
- enable smartd (watch the CRC count and disk health)

The kernel parameters need a reboot to take effect.
2026-09-21 17:37:52 +08:00
ryan4yin | 二花 4867e94171 Merge pull request #294 from ryan4yin/chore/drop-kubevirt-guest
chore: drop the KubeVirt guest bits and dead upload recipes
2026-09-21 17:29:49 +08:00
Ryan Yin 8b1fa3ac87 chore(secrets): drop the unreferenced dae-subscription secret
Nothing consumes it (it was gated on modules.secrets.server.network)
and its only content was the secret definition.
2026-09-21 17:29:36 +08:00
Ryan Yin 03619f8055 chore(utils.nu): drop the dead upload-vm helper
It wrote a built image into a KubeVirt DataVolume over the CDI upload
proxy; with KubeVirt gone (and the Justfile callers removed) it is dead
code.
2026-09-21 17:27:16 +08:00
Ryan Yin dbeef8bfaa docs: drop Virtual-Machine.md
It documented the retired KubeVirt workflow (upload a qcow2, create the vm
in k8s-gitops, let Flux create it), which no longer exists. The general
deployment notes live in the README and the per-platform docs
(hosts/k8s/README.md for the microVMs).
2026-09-21 17:26:38 +08:00
Ryan Yin e939c54d26 chore: refresh the remaining KubeVirt references
Update the user-facing bits that still pointed at KubeVirt: the homepage
dashboard group and entries (and drop the dead LongHorn one), the docs,
and remove the now-unneeded virtctl package.
2026-09-21 17:25:38 +08:00
Ryan Yin 6180072646 chore: drop the KubeVirt guest bits
The k3s-test workers never ran (they were stuck waiting for volume
binding) and will be re-added as microVMs, so remove their KubeVirt
configs and everything that only existed for KubeVirt guests:

- hosts/k8s/k3s-test-1-worker-{1,2,3} and their outputs
- lib/genKubeVirtGuestModule.nix and lib/genK3sAgentModule.nix (the
  latter was only used by the workers)
- the KubeVirt image upload recipes (upload-vm, upload-idols,
  upload-k3s-test) and the kubevirt image package in the idols outputs
- refresh the docs; keep only accurate historical mentions (e.g. the
  restic backup path must stay as it is)
2026-09-21 17:24:40 +08:00
ryan4yin | 二花 8427dee2e6 Merge pull request #292 from ryan4yin/chore/rename-12kingdoms
refactor: rename the three VM hosts to 12kingdoms-*
2026-09-21 17:11:58 +08:00
Ryan Yin 2c7629000f refactor: rename the three VM hosts to 12kingdoms-*
Drop the now-meaningless kubevirt- prefix and move the hosts out of
hosts/k8s/, following the existing 12kingdoms-shoukei layout: the
directory and output carry the theme prefix while the configuration,
hostname and colmena target are the bare name (shoryu, shushou, youko).

- hosts/k8s/kubevirt-* -> hosts/12kingdoms-*; the shared disko config
  becomes host-disko-fs.nix; the now-different relative imports are fixed
- outputs, vars/networking.nix keys, the Justfile recipes/tags, the eval
  tests and the docs follow
- colmena reaches these hosts by IP (a new targetHost override), since
  their DNS name changes with the hostname and is not resolvable until
  the router learns it
2026-09-21 17:10:14 +08:00