87 Commits
Author SHA1 Message Date
ryan4yin | 二花 71fa928254 feat(canokey): sudo, SSH, LUKS and OpenPGP setup for daily use (#516)
Use the CanoKey for daily authentication on idols-ai and shoukei, with
the existing passwords, passphrases and per-host SSH keys as fallback.

- sudo: pam_u2f with a shared origin (pam://ryan4yin) and a Nix-store
  authfile built from myvars.canokeyU2fKeys; the primary key is
  registered and touch-to-sudo works on idols-ai.
- SSH: one resident ed25519-sk key (application=ssh:ryan4yin) exported
  to ~/.ssh/id_ed25519_sk; GitHub tries it before the per-host key.
- shoukei LUKS: fido2-device=auto with token-timeout=10s. Update
  nixos-apple-silicon (linux-asahi 7.2.14), whose initrd adds
  thunderbolt_apple and reset_apple_cio so USB-C comes up before unlock.
- GPG: scdaemon disable-ccid so it uses pcscd.
- docs/security-keys.md: setup, PINs, enrollment, backup key and
  recovery; deduplicate the FIDO notes left by #515.

Assisted-by: Claude Code (claude-opus-5-5)
2026-11-04 01:50:21 -06:00
Ryan Yin 4470b3d014 docs: centralize documentation under docs/
Move standalone repository docs from the root into docs/ and add a documentation index that links the moved docs and the code-local runbooks.

Update Markdown links, source comments, and the root entry points to the new locations. Keep README.md and AGENTS.md at the root as required entry points.

Assisted-by: DeepSeek Harness (deepseek-flash)
2026-11-02 17:48:57 +08:00
Ryan Yin 70d8bd6791 refactor(shoukei): drop dead nettle and qemu-user static overlays
Both only touch pkgsStatic builds, which nothing on this host pulls in
since qemu-user binfmt was removed; the toplevel drvPath is unchanged.

Assisted-by: Claude Code (claude-opus-5-5)
2026-11-01 11:55:14 -06:00
Ryan Yin 42341491f3 refactor(shoukei): cap battery charging from a udev rule
macsmc-battery's "add" uevent fires before the supply accepts writes
(power_supply_register bumps use_cnt after device_add); its deferred
register work then emits "change". Match both instead of polling for 30 s
from a oneshot.

Assisted-by: Claude Code (claude-opus-5-5)
2026-11-01 11:42:57 -06:00
Ryan Yin e4c2548a93 refactor: replace redundant mkForce with plain values and mkDefault
Each of these overrode a value nothing else set at a higher priority:

- qemu-guest: btrbk, hardwareTools and cloud-init have no competing
  definition on the guests.
- mdns: nixpkgs' sunshine module sets avahi.publish.* with mkDefault.
- computer-use: i18n now sets the time zone with mkDefault.
- darwin terminal: the shared ghostty/kitty font sizes are now mkDefault.
- shoukei: sunshine is mkDefault false in remote-desktop.nix, zram's
  memoryPercent is mkDefault 50; supportedFilesystems now merges instead
  of discarding the fsType entries other modules add.
- youko: nothing enables docker.
- nixpak: pasta.enable and sockets.pipewire are mkDefault in the shared
  modules, sockets.pulse already was.

Every NixOS host's toplevel drvPath is unchanged; on fern and frieren the
terminal font sizes and time zone evaluate to the same values.

Assisted-by: Claude Code (claude-opus-5-5)
2026-11-01 10:14:27 -06:00
Ryan Yin a97400df69 fix(systemd): sandbox privileged hardware oneshots
Assisted-by: DeepSeek Harness (deepseek-flash)
2026-11-01 20:49:51 +08:00
ryan4yin | 二花 d6450d48a2 feat(remote-builders): build ai and shoukei on aquamarine (#467)
Aquamarine builds for ai and shoukei across the three platforms, with both
daemons logging in as root. They authenticate with their passphrase-free SSH
host keys, and ssh_known_hosts now carries each builder's address.

Assisted-by: DeepSeek Harness 0.2.0-rc.2 (deepseek-flash)
2026-10-17 00:49:22 +08:00
ryan4yin | 二花 3266aad4a2 fix(power): drop TuneD for native CPU scaling (#461) 2026-10-16 16:45:08 +08:00
ryan4yin | 二花 b4b293ebfa fix(power): pin the tuned profile per host, cap the VM hosts (#458)
Assisted-by: DeepSeek Harness (deepseek-flash)
2026-10-16 00:42:48 +08:00
ryan4yin | 二花 e6deb4b564 feat(shoukei): cap battery charging at 90% (#457)
Assisted-by: DeepSeek Harness (deepseek-flash)
2026-10-16 00:37:06 +08:00
Ryan Yin b24f30c38c fix(shoukei): route DNS through the mihomo TUN
Assisted-by: DeepSeek Harness (gpt-6-astra)
2026-10-14 18:34:48 +08:00
ryan4yin | 二花 9c38819517 docs: review and correct comments and documentation (#436) 2026-10-12 10:02:38 +08:00
ryan4yin | 二花 835b7f6df1 feat(shoukei): pin home Wi-Fi to a static IPv4 & adjust networking.nix (#407) 2026-10-07 21:27:34 +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 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 | 二花 5f6a1dadf4 docs: fix stale claims and AI-flavored prose (#397) 2026-10-07 14:48:36 +08:00
Ryan Yin 524770b351 security(shoukei): disable prometheus exporters 2026-10-03 17:21:37 +08:00
Ryan Yin efdf153f0a fix(shoukei): stop latched nscd failures on resolvconf restarts 2026-10-03 09:42:13 +08:00
ryan4yin | 二花 b2ec56db66 docs(skills): add repo-scoped task skills and give each fact one home (#337) 2026-10-02 10:13:03 +08:00
Ryan Yin 69f60095ae fix(networking): drop shoukei static address
shoukei is a laptop using DHCP and never consumes hostsAddr.shoukei.
Its 192.168.5.108 collided with k3s-prod-1-master-1 and produced a wrong
ssh Host shoukei entry.
2026-09-20 20:26:17 +08:00
ryan4yin | 二花 f8d12ada24 feat(btrbk): make snapshots explicit, guarded, and stored in @snapshots (#271)
* feat(btrbk): make snapshots explicit and guarded

Replace the always-on, hardcoded module with modules.btrbk options (enable/volume/subvolume/snapshotDir/target/onCalendar), and assert the btrfs top-level subvolume is mounted so a missing mount fails evaluation instead of silently failing at runtime.

Store snapshots in the @snapshots subvolume (snapshot_dir=@snapshots) rather than next to the live subvolume, make the off-host target explicit and off by default, and document that local snapshots are not off-host backups.

Enable the feature explicitly on idols-ai, shoukei and the three kubevirt hosts; qemu-guest now disables it through the option. Add eval tests for shoukei and ai.

* feat(monitoring): alert on btrbk snapshot failure

Add HostBtrbkSnapshotFailed on node_systemd_unit_state for btrbk-btrbk.service, so a broken snapshot schedule alerts instead of only surfacing in the journal.
2026-09-19 11:43:11 +08:00
Ryan Yin 83833bf871 fix: use valid shoukei logind keys 2026-09-03 23:26:03 +08:00
Ryan Yin c6bbb69b3d fix(shoukei): muvm failed to build currently 2026-08-30 23:02:51 +08:00
Ryan Yin 099752e89f fix(shoukei): restore tuigreet login, autologin bypassed the lock screen
greetd ran the niri session directly, so exiting the session (e.g.
logout from the lock screen) made greetd immediately restart the
desktop with no authentication.
2026-08-30 21:47:57 +08:00
Ryan Yin cce15300d6 feat(niri): reorganize workspaces 2026-08-03 22:42:37 +08:00
Ryan Yin 071212e40f feat(niri): reorganize workspace layout 2026-07-31 12:06:27 +08:00
Ryan Yin 095dc5dee8 feat(desktop): enable the firewall on desktop machines
Signed-off-by: Ryan Yin <xiaoyin_c@qq.com>
2026-07-26 22:26:01 +08:00
Ryan Yin 74598b6f6b chore(monitoring): stop scraping offline hosts, mute noisy alert levels
- Add an offlineHosts list to VictoriaMetrics scrape generation: SBCs
  and the whole k3s-prod-1 cluster are powered off, shoukei's exporter
  is disabled on the machine; also comment out the dnsmasq-exporter
  job (runs on suzi).
- Disable node-exporter on shoukei: a laptop on untrusted networks
  should not expose :9100 (the firewall is off repo-wide).
- Route severity none|info alerts to the null receiver; meta alerts
  and info noise should never page.

Signed-off-by: Ryan Yin <xiaoyin_c@qq.com>
2026-07-26 22:19:56 +08:00
Ryan Yin cf7b5a5be7 refactor(home): move host home-manager configs out of hosts 2026-03-23 10:57:09 +08:00
Ryan Yin 0c23a823c6 feat(shoukei): reduce size limit for root tmpfs 2026-03-20 22:49:21 +08:00
Ryan Yin 6a03dddcbd feat: add size limit for root tmpfs 2026-03-20 18:27:41 +08:00
Ryan Yin 4b5a7b1be7 fix: macbook do not have a tpm2 device for luks auto unlock
Signed-off-by: Ryan Yin <xiaoyin_c@qq.com>
2026-03-18 22:47:45 +08:00
Ryan Yin 57a868228c fix: systemd.sleep.extraConfig no longer has any effect 2026-03-16 17:31:46 +08:00
0x0D 120dd53a7f fix(niri): add workspaces 7, 8, 9 for proper bar ordering (#246)
* Create reorder-workspaces.sh
* Update keybindings.kdl
* Update config.kdl
* Update niri-hardware.kdl
* fix(niri): add workspaces 7, 8, 9 for proper bar ordering
2026-03-16 00:04:34 +08:00
Ryan Yin 69f77fecca feat: new host - idols-akane, hardens VFAT /boot mounts (#245)
* feat: new host - idols-akane

* fix: missing efi files

* fix: efi partition - permission issue
2026-03-07 23:54:13 +08:00
Ryan Yin fb7a0cd178 feat: replace waybar/mako/anyrun/wlogout/swaylock with noctolia-shell, remove hyprland (#240) 2026-01-03 09:36:54 -06:00
Ryan Yin 847adc7d63 feat: add power management service 2026-01-03 20:16:37 +08:00
Ryan Yin 94e431abfc fix: error - only one wireless daemon is allowed at the time, speed up wechat download 2026-01-02 22:37:38 +08:00
Ryan Yin 9f4ff5a8a3 feat: update inputs, remove asahi's mesa workaround 2025-12-25 13:12:43 +08:00
Ryan Yin 2bc25074a6 feat: apple touchbar - remove search key 2025-12-19 16:20:47 +08:00
Ryan Yin 219a7a6e0b feat: apple touchbar - add f1 f2 & f12 2025-12-19 16:19:19 +08:00
Ryan Yin 29760ddb27 refactor: update niri, write config in kdl, remove niri-flake (#237)
• Updated input 'nixpkgs':
  → 'github:NixOS/nixpkgs/0254eab410b90ef2420c1059f908ae777e3b02f9?narHash=sha256-/US2Ei9JHXHVBAxV4FX49Q7H5s4UNBrIiOA6Xjzgq44%3D' (2025-12-06)

• Updated input 'home-manager':
    'github:nix-community/home-manager/f4cb25928fafa9ae68660fe71f730fc820a59028?narHash=sha256-5xOuutXM7UPTUcn3uDAD8UlPQsXmqPrX81cXoDOAGcA%3D' (2025-11-26)
  → 'github:nix-community/home-manager/89c9508bbe9b40d36b3dc206c2483ef176f15173?narHash=sha256-rB45jv4uwC90vM9UZ70plfvY/2Kdygs%2BzlQ07dGQFk4%3D' (2025-12-17)

• Updated input 'nixpkgs-master':
    'github:nixos/nixpkgs/6812bcfd614abedbdb3f68d7b6554eda6ca3e014?narHash=sha256-sNF/PZcuzYBHKRBkerEiPf5mkZM15A3fWD%2BlqpwKc60%3D' (2025-12-15)
  → 'github:nixos/nixpkgs/e50ab9bb181f9fb3ce00e7a6007c70ddaa007203?narHash=sha256-acPMRCAPgPykzkwATwD1EfF7xgmbraAvIJyCeR6bKxc%3D' (2025-12-18)

Signed-off-by: Ryan Yin <xiaoyin_c@qq.com>
2025-12-18 19:56:46 -06:00
Ryan Yin 4163d09af8 feat: optimizing swap on zram 2025-11-28 19:21:36 +08:00
Ryan Yin 3bf1b986cf feat: upgrade nixpkgs stable to 25.11, update nixos-apple-silicon, gh… (#236)
* feat: upgrade nixpkgs stable to 25.11, update nixos-apple-silicon, ghostty, anyrun, etc
* fix: asahi-nixos - revert mesa to 25.2.6
* fix: disable gitui - it's broken on aarch64-darwin currently

---------

Signed-off-by: Ryan Yin <xiaoyin_c@qq.com>
2025-11-26 20:54:44 -06:00
Ryan Yin 34fdd92351 feat: comment out nixpkgs-unstable, we use unstable by default (#232)
* feat: comment out nixpkgs-unstable, we use unstable by default

Signed-off-by: Ryan Yin <xiaoyin_c@qq.com>

* fix: typo...

---------

Signed-off-by: Ryan Yin <xiaoyin_c@qq.com>
2025-11-01 07:21:57 -06:00
Ryan Yin 492708cfc7 feat: nixos-apple-silicon - build full NixOS kernel to enable BTF/BPF 2025-10-16 13:15:35 +08:00
Ryan Yin 6f09e34c21 fix: qemu-user-static on aarch64 - disable pie 2025-09-24 14:35:26 +08:00
Ryan Yin 553e8d16e5 fix(WIP): qemu-user-static - too many GOT entries for -fpic, please recompile with -fPIC 2025-09-24 14:19:27 +08:00
Ryan Yin e3a33fdf03 fix: podman cross platform - binfmt 2025-09-24 11:47:23 +08:00
Ryan Yin 070aeae8db feat: gaming (#223)
* refactor: configure gaming suite via options, use pkgs-x64
* fix: gaming on apple silicon (not work yet)
2025-09-17 13:54:27 +08:00