Commit Graph
2652 Commits
Author SHA1 Message Date
Ryan Yin dd46fb3fb2 docs(agents): clarify credential boundaries and rule maintenance 2026-10-08 23:45:47 +08:00
Ryan Yin 19b9aff7bf fix(tuios): handle stopped daemon during shell startup 2026-10-08 23:39:38 +08:00
ryan4yin | 二花 4a27852fd1 fix(tuios): create sessions with cwd before attaching (#418) 2026-10-08 20:50:28 +08:00
ryan4yin | 二花 48ac4f76bf fix(tuios): keep sessions across reboots and split them by purpose (#416) 2026-10-08 20:29:52 +08:00
Ryan Yin 9ba2cf5229 chore: pin tuios to v0.9.0; require pinned third-party inputs 2026-10-08 15:47:20 +08:00
ryan4yin | 二花 60bd70bd0c refactor(agents): configure dsh from its profile patch (#415) 2026-10-08 15:29:31 +08:00
ryan4yin | 二花 9e2633f496 feat(gaming): generic umu game installer, skill, and desktop entries (#411) 2026-10-08 14:59:11 +08:00
ryan4yin | 二花 efd279c7d1 fix(noctalia): avoid mihomo network speed double count (#414) 2026-10-08 13:31:57 +08:00
ryan4yin | 二花 dc211bbca3 fix(mihomo): restore the Steam community and store PROXY rules (#412)
The comment trim dropped them. Without a domain rule above the Valve IP ranges,
steamcommunity.com and steampowered.com match those ranges and go DIRECT.
2026-10-08 09:50:41 +08:00
ryan4yin | 二花 257e9b13d2 docs: add the NixOS modernization options and decision record (#409) 2026-10-08 09:49:29 +08:00
Ryan Yin 0b29b15697 feat: add nh 2026-10-08 09:44:19 +08:00
ryan4yin | 二花 ded8d91507 feat(mihomo): keep Steam downloads off the proxy so Steam keeps a CN CDN (#408)
Steam picks download caches from the IP it sees on the CM login. Pin the CM hosts
and content CDN DIRECT, keep the community and store proxied, and add Valve's
AS32590 ranges because Steam dials cached CM IPs without a lookup. Sources in
README.md.
2026-10-08 09:41:51 +08:00
ryan4yin | 二花 c89c5e9698 fix(mihomo): say what a dropped catch-all actually costs (#410) 2026-10-08 09:40:17 +08:00
ryan4yin | 二花 835b7f6df1 feat(shoukei): pin home Wi-Fi to a static IPv4 & adjust networking.nix (#407) v0.18.0 2026-10-07 21:27:34 +08:00
Ryan Yin e9d706aa96 fix(apparmor): correct the sudo profile comment's conclusion
The abort needs havePrivateMountNs == false AND /nix/store still ro:
remountReadOnlyWritable() returns early while the store is writable. Nix
<= 2.34 left it rw until reboot; 2.35 remounts in a private namespace, so
only a freshly booted host hits it. The repro command also uses an open-only
exec 7<..., since cat fails on the read even when the open succeeds.

While here, trim the comments and drop the disabled default_deny/nix
policies plus the explicit killUnconfinedConfinables=false (nixpkgs
default). 82 -> 34 lines.
2026-10-07 20:22:43 +08:00
Ryan Yin 124bcd8490 docs: drop the stale "just test exit code" caveat
`just test` has enforced the suite result since #350: the recipe raises unless
`evalTests` is `true`, so a zero exit already means pass. Update the places that
still described the old raw-`nix eval` behaviour: AGENTS.md, README.md,
SECURITY.md, outputs/README.md, and the nix-config-debug / nix-config-new-host /
nix-config-update skills.

The exit-0 caveat is kept only where the raw `nix eval .#evalTests` command is
documented, because that command genuinely exits 0 even on `false`.
2026-10-07 19:54:32 +08:00
ryan4yin | 二花 6f136b50e4 fix(shoukei): mitigate brcmfmac wifi auth failures, document duplicate-profile bug (#406)
BCM4378/brcmfmac intermittently fails Wi-Fi association (ASSOC-REJECT /
authentication timeout) on this laptop. NetworkManager misreads the failure
as a bad key and re-prompts; whichever client reconnects (Noctalia, nmtui,
nmcli) then saves the answer as a duplicate "<SSID> 1" profile. The problem
predates the Noctalia v5 shell and is driven by the driver, not the shell.

- disable Wi-Fi powersave on shoukei, a common source of brcmfmac auth timeouts
- WORKAROUNDS.md WA-024: the powersave mitigation and its removal condition
- WORKAROUNDS.md WA-025: the pending upstream brcmfmac port_authorized fix
- document how to recover a wedged supplicant without rebooting, and that
  deleting an active NM profile is what turned a reconnect into a dead link

Refs: https://patchew.org/linux/20260915-brcmfmac-4way-handshake-offload-authenticated-event-v2-1-fbb9cc7ac177@jannau.net/
2026-10-07 19:52:57 +08:00
Ryan Yin 0d800c4d9c fix(apparmor): attach disconnected paths in the sudo profile
Nix 2.35's root nix-env -- used by nixos-rebuild to set the system profile --
calls saveMountNamespace(), which opens /proc/self/ns/mnt before remounting
the read-only /nix/store writable. Those magic links have no connected path,
so AppArmor cannot match them against any rule and denies the open with
EACCES even in complain mode. The private mount namespace is then never
created and nixos-rebuild aborts with:

  cannot remount "/nix/store" writable: not in a private mount namespace

Adding flags=(attach_disconnected) lets AppArmor re-root those paths on / so
the existing `file /**` rule matches. This also fixes any other sudo'd tool
that needs namespaces (unshare, nsenter, bwrap, ...).

Rolling this out to a host that already has the old profile loaded needs one
deploy with --no-reexec, so the current system's Nix performs nix-env --set
instead of the new system's; after that generation is active, plain
`just niri` works and the Nix version is never rolled back.
2026-10-07 19:39:42 +08:00
Ryan Yin 94312fc2e5 ci: bound and retry the Gitee mirror push
Gitee's SSH gateway intermittently accepts the connection and key, then never
answers the initial git-receive-pack and drops the session ~100s later with
"the remote end hung up upon initial contact". The same failure mode shows up
sporadically since 2026-10-02 and spiked on 2026-10-07 (9 of 14 runs failed).

Bound each push attempt with `timeout`, retry up to six times with exponential
backoff, and add ssh connect/keepalive timeouts. Serialize runs (a push to main
and a tag on the same commit used to race for Gitee's per-repo push lock), cap
the job at 30 minutes, and allow manual workflow_dispatch reruns.
2026-10-07 19:02:46 +08:00
ryan4yin | 二花 8f065f24bc feat(nix): use Nix 2.35 via nixVersions.latest (#405)
Nix 2.35 brings lazy flake source copying, mimalloc (5-12% faster
evaluation), lower nix-daemon memory use, HTTP/3 support, and jittered
transfer retries with Retry-After.
2026-10-07 18:32:09 +08:00
ryan4yin | 二花 b64adc4c20 docs(security): correct the M3 pod-to-node control #403 2026-10-07 17:58:54 +08:00
ryan4yin | 二花 df6f9b8d6d feat(k3s): disable kube-proxy for Cilium eBPF replacement (#404) 2026-10-07 17:58:33 +08:00
ryan4yin | 二花 2af97e37b9 feat(shoukei): x86 emulation via muvm+FEX, drop pkgs-x64 (#394)
* feat(shoukei): run x86/x86_64 apps and games via muvm+FEX

Apple Silicon's 16K pages mean FEX cannot run natively and qemu-user cannot
run complex x86_64 binaries. Wire the maintained rowanG077/nix-x86-on-aarch64
runtime (FEX inside a 4K muvm microVM) into shoukei so games, Steam, Wine and
other x86/x86_64 programs work, and let the module own the x86 ELF handlers
instead of qemu-user.

The input is pinned to our fork (ryan4yin/nix-x86-on-aarch64) at the reviewed
commit. Dropping boot.binfmt.emulatedSystems also removes x86_64 from
nix.settings.extra-platforms, so the qemu-user/uncached-x86-build gap is
recorded as WA-022.

- flake.nix: add nix-x86-on-aarch64 input (WA-021)
- hosts/12kingdoms-shoukei/game/: programs.x86-on-arm + steam/wine, 6 GiB VM
- hardware-configuration.nix: drop emulatedSystems/preferStaticEmulators
- apple-silicon.nix: drop the now-redundant box64
- docs: WA-012 resolved; WA-021 and WA-022 added; host README updated

* refactor(nixpkgs): drop the repo-wide pkgs-x64 package set

Every remaining pkgs-x64 consumer runs only on x86_64-linux hosts, where the
native pkgs already carries the same allowUnfree config
(modules/nixos/base/nix.nix) and overlays (modules/base/overlays.nix), so
replace the references with pkgs and drop the extra nixpkgs instantiation
(which also removes an eval on aarch64-darwin).

media.nix keeps the native Zoom app on x86_64 hosts only, since zoom-us has
no aarch64 Linux build.
2026-10-07 16:03:59 +08:00
Ryan Yin 13fe324507 refactor(nixpkgs): drop the repo-wide pkgs-x64 package set
Every remaining pkgs-x64 consumer runs only on x86_64-linux hosts, where the
native pkgs already carries the same allowUnfree config
(modules/nixos/base/nix.nix) and overlays (modules/base/overlays.nix), so
replace the references with pkgs and drop the extra nixpkgs instantiation
(which also removes an eval on aarch64-darwin).

media.nix keeps the native Zoom app on x86_64 hosts only, since zoom-us has
no aarch64 Linux build.
2026-10-07 15:56:58 +08:00
Ryan Yin 3e4e093869 feat(shoukei): run x86/x86_64 apps and games via muvm+FEX
Apple Silicon's 16K pages mean FEX cannot run natively and qemu-user cannot
run complex x86_64 binaries. Wire the maintained rowanG077/nix-x86-on-aarch64
runtime (FEX inside a 4K muvm microVM) into shoukei so games, Steam, Wine and
other x86/x86_64 programs work, and let the module own the x86 ELF handlers
instead of qemu-user.

The input is pinned to our fork (ryan4yin/nix-x86-on-aarch64) at the reviewed
commit. Dropping boot.binfmt.emulatedSystems also removes x86_64 from
nix.settings.extra-platforms, so the qemu-user/uncached-x86-build gap is
recorded as WA-022.

- flake.nix: add nix-x86-on-aarch64 input (WA-021)
- hosts/12kingdoms-shoukei/game/: programs.x86-on-arm + steam/wine, 6 GiB VM
- hardware-configuration.nix: drop emulatedSystems/preferStaticEmulators
- apple-silicon.nix: drop the now-redundant box64
- docs: WA-012 resolved; WA-021 and WA-022 added; host README updated
2026-10-07 15:55:55 +08:00
ryan4yin | 二花 f5a111c638 feat(backup): hourly read-only snapshots and per-backup integrity checks (#402)
* feat(restic): verify the repository after each backup

* feat(youko): snapshot the restic store hourly

* docs(backup): document the snapshot and check layers
2026-10-07 15:26:57 +08:00
ryan4yin | 二花 3694961e74 fix(postgres,darwin): close the loopback superuser path and scope agenix ownership (#401)
* fix(postgres): require a password for superuser over TCP

* test: assert the postgres loopback auth rules

* fix(darwin): keep root-only agenix secrets root-only

* docs(security): record the local auth boundaries and retire WA-015
2026-10-07 15:22:03 +08:00
ryan4yin | 二花 3acb5d4ee5 fix(nfs,libvirt): restrict the golden export and bind VNC to loopback (#400)
* fix(nfs): restrict the golden export to its real clients

* fix(libvirt): bind VNC consoles to loopback

* fix(firewall): drop VNC ports on every host

* docs(security): record the NFS and VNC boundaries
2026-10-07 15:10:52 +08:00
ryan4yin | 二花 43f39e8e9f fix(k3s): deny credential-bearing host ports to pod sources (#399)
* fix(k3s): deny credential-bearing host ports to pod sources

* test: assert the k3s pod firewall drops sensitive ports

* docs(security): record the pod firewall boundary
2026-10-07 15:03:56 +08:00
ryan4yin | 二花 b79c5807ae ci: harden workflows and run the runtime firewall VM test (#398)
* ci: pin actions, scope tokens, run the runtime security VM test

* test: add a just recipe for the runtime firewall VM test
2026-10-07 14:57:34 +08:00
ryan4yin | 二花 5f6a1dadf4 docs: fix stale claims and AI-flavored prose (#397) 2026-10-07 14:48:36 +08:00
Ryan Yin fabccbafda fix(monitoring): ignore openapi discovery in apiserver latency alert
KubernetesApiServerLatency fired continuously on the p99 of
apiserver_request_duration_seconds_bucket. Every firing series was
verb="GET", subresource="openapi/v3" (kubelet, kube-controller-manager,
kube-scheduler, apiserver) at ~8s, while real verbs (POST/LIST/DELETE)
stay around 0.2s.

openapi/v3 is a streaming discovery endpoint, like WATCH, so exclude
subresource=~"^openapi/" from the rule.
2026-10-07 13:21:43 +08:00
ryan4yin | 二花 76c4566e9b fix(k8s): pass inputs to the MicroVM guests (#396)
Host builds have been broken since #375 - function called without argument inputs
2026-10-07 13:20:08 +08:00
ryan4yin | 二花 95b849420e feat(gaming): declarative Proton and dGPU game rendering (#393) 2026-10-07 13:14:42 +08:00
ryan4yin | 二花 90bbe8bc4f fix(monitoring): stop recurring false alerts (#395)
The Telegram channel was dominated by alerts that can never be actionable:

- DriveTemperatureHigh/Critical did not filter temperature_type, so
  max(smartctl_device_temperature) picked the drive's rated
  op_limit_max/critical_limit_max instead of the actual reading. ai reported
  95 C and youko 130 C while the drives actually ran at 40-48 C.
- HostPhysicalComponentTooHot excluded label!="tctl", but the AMD k10temp
  hwmon sensor labels itself Tctl, so the CPU control temperature (up to
  ~100 C under load) tripped the alert on every AMD host.
- MicroVM guests share the host's read-only /nix/store, so their
  nix-gc.service always failed and tripped HostSystemdServiceCrashed on all
  six k3s guests. Disable automatic GC in the guest; the host's nix.gc
  reclaims the shared store.

The remaining k3s alert noise comes from workloads running on the masters
that belong on the workers; that is fixed in k8s-gitops, not by resizing
the control-plane VMs.
2026-10-07 12:51:30 +08:00
Ryan Yin a7cc474a50 docs(hosts): update the idols-ai memory notes for 1.28 V
The bring-up runs at the default 1.25 V; afterwards Gear mode is set to
Gear2 and VDD/VDDQ are raised to 1.28 V, changing nothing else. 1.29 V and
up do not train. Also record that the 1.25 V config passed stressapptest
but still hard-froze under a real llama.cpp load, so a passing test is not
proof of stability.
2026-10-07 07:38:52 +08:00
Ryan Yin a091fe1aca docs(hosts): refresh the ai screenshots and correct its hardware notes
- replace the btop screenshot with the 2026-10-06 annotated capture
  (btop + fastfetch + the strata/llama.cpp serving logs); the old
  2026-10-01 file is gone, so the README link moves to the new name
- drop the Helix/AI-agents screenshot and its README reference
- fix stale hardware descriptions: the hosts/README.md inventory row and
  the idols-ai header comment still said i5-13600KF, and the zswap pool
  comment sized its percentages against the old 96G of RAM (now 128G)
- record the hardware history: the platform was rebuilt on 2026-04-27
  (PR #257/#258) onto the Colorful CVN Z890 ARK FROZEN + Core Ultra 7
  270K Plus, replacing the MSI board and i5-13600KF the host was added
  with in 2023-05; the 2x48G kit predates that rebuild, the 2x16G kit
  was added 2026-10-06
- make the DIMM bring-up order mandatory and record its failure mode:
  with the 48G pair in first, or all four DIMMs from the start, the
  board does not POST
- gloss the Chinese BIOS labels in English, marked as translations of
  the labels rather than the firmware's own English wording

Left alone on purpose: the 96G swapfile in hosts/idols-ai/disko-fs.nix.
It was grown from 20G to 1x-RAM on 2026-10-02 (a26ab3be), when the host
still had 96G; resizing it again means re-running disko on the machine,
so that stays a separate decision.
2026-10-06 22:32:34 +08:00
ryan4yin | 二花 e653ec3306 docs(hosts): add mixed-memory notes for idols-ai (#391)
Document the 4-DIMM kit mix (2×48G JUHOR + 2×16G GLOWY) on the Colorful
CVN Z890 ARK FROZEN V20:

- hardware (CPU, board, and both kits)
- the install order that trains (16G pair first)
- the only stable settings (XMP off, DDR5-4800 @ 1.25 V)
- the stress-test recipe and results
- the XMP @ 5600 failure and how to recover a board that will not POST
- re-enrolling the LUKS TPM unlock after a BIOS change
2026-10-06 21:39:23 +08:00
Ryan Yin 87e87aad7d fix(agents): perserve dsh data 2026-10-06 17:00:01 +08:00
ryan4yin | 二花 dc65254511 fix(ssh): make sandboxed ssh work on Linux (#390) 2026-10-06 15:20:53 +08:00
ryan4yin | 二花 187577b2da docs(agents): fix the dsh private model route recipe (#389)
`dsh-llm-pi-ai` registers its built-in providers once, so a second instance
in the profile patch fails on mount with `provider "..." is already declared`.
Extend the base `llm-pi-ai` row instead.
2026-10-06 14:10:54 +08:00
ryan4yin | 二花 28e0b156ce refactor(agents): link dsh shared policy as a home-layer patch (#388)
dsh rewrites a profile's cordis.patch.yml at runtime, so linking the web
profile put GUI state in the checkout and let runtime writes clobber manual
edits. Link the stable policy as the $DSH_HOME home layer instead: dsh applies
it after every profile and only reads it.

The host-plane compaction-basic row is disabled on the web surface and each
agent preset owns its own copy, so the top-level override was inert. Drop it;
the model contextWindow/maxTokens are the effective knobs.

- add home/base/tui/agents/dsh/cordis.patch.yml, linked from default.nix
- drop the ~/.dsh/profiles/web link and the tracked web/ profile
- keep runtime state and private/local model routes in the profile patch
- update the eval test and README
2026-10-06 14:04:55 +08:00
ryan4yin | 二花 205f7c622b feat(agents): version the dsh web profile and add a proxied launcher #387 2026-10-06 00:54:30 +08:00
Ryan Yin 975d2668a8 feat(idols-ai): back up the dsh state directory (~/.dsh) with restic
dsh keeps its session transcripts, workspace storages, and profiles in
DSH_HOME=~/.dsh, which was outside the backup allowlist. Exclude its
.credentials.yaml like the module's other credential paths.
2026-10-05 23:46:04 +08:00
Ryan Yin 2e77458766 feat(noctalia): add 10s confirm countdown to session menu actions
Explicit session action lists replace the built-in defaults, so re-declare all
five actions; lock stays immediate, logout/suspend/reboot/shutdown arm a 10 s
countdown that a second press runs immediately.
2026-10-05 23:33:15 +08:00
Ryan Yin d7e169d56c docs(rime): reload the rime addon via busctl instead of fcitx5-remote 2026-10-05 23:27:03 +08:00
Ryan Yin 9cc5d92451 fix(desktop): restore dynamic light/dark for Qt apps
QT_QPA_PLATFORMTHEME=gtk3 (from #386) made Qt derive its color scheme
from GTK3, which has no dynamic dark/light signal, so Telegram and other Qt
apps were stuck on the light palette after Noctalia's theme mode changed.

Use the portal theme instead: Qt then follows
org.gnome.desktop.interface color-scheme, which Noctalia writes. The trade-off
is Qt's built-in "Sans Serif" 9pt font, which a font-providing platform theme
would be needed to change.
2026-10-05 23:14:28 +08:00
Ryan Yin a52e9dbbd7 fix(noctalia): drop the duplicate Now Playing OSD
go-musicfox posts its own desktop notification on every track change and both popups sit at bottom_right, so the media OSD was a second, redundant popup.
2026-10-05 22:46:13 +08:00
ryan4yin | 二花 85c51f5769 feat(rime): share the Rime config and user dictionary across Linux and macOS (#385)
* feat(rime): share the Rime config and user dictionary across Linux and macOS

Move the Rime data, preferences, and user dictionary into home/base/gui/rime so fcitx5-rime and Squirrel read the same files.

* feat(vinput): open the command palette with right Ctrl

Pin keyd's right-hand modifiers (rightcontrol/rightshift/rightmeta) to their own keycodes; keyd otherwise folds them into the left keys. Set Vinput's MenuKey to right Ctrl and clear CommandKeys, which would shadow it.

* feat(fcitx5): switch CN/EN with Ctrl+Space and right Shift

Clear AltTriggerKeys, whose Shift_L default toggled on left Shift. Left Shift is now a plain modifier and right Shift switches through the shared Rime config.
2026-10-05 22:43:20 +08:00
Ryan Yin 9442a82d91 feat(fcitx5): switch CN/EN with Ctrl+Space and right Shift
Clear AltTriggerKeys, whose Shift_L default toggled on left Shift. Left Shift is now a plain modifier and right Shift switches through the shared Rime config.
2026-10-05 22:41:49 +08:00