Introduction
This repository is a Nix Flakes-based dotfiles and system configuration, managing NixOS systems and Home Manager user environments across multiple machines.
It uses flake-parts with autowire (from jig) for automatic module discovery and composition.
Repository Structure
flake.nix # Entry point, declares all inputs
→ flake/*.nix # Flake-level glue (configs, formatter, activation)
→ packs/{home,nixos}/ # Autowired packs (common, host, container, gui)
→ mixins/{home,nixos}/ # Opt-in configs (manually imported by configurations)
→ home/*.nix # Per-user base Home Manager configurations
→ nixos/{hosts,containers} # Per-host/container NixOS configurations
packs/— Autowired collections — import a pack, get everything in itmixins/— Opt-in configuration pieces (services, hardware, versions)home/— Base Home Manager configs (yjpark.nix,yj.nix)nixos/— Per-host and per-container NixOS configssecrets/— SOPS-encrypted secrets (age keys, per-host)private/— Host-specific private configs (gitignored, present on deployed machines)
Architecture
Autowiring Pattern
Pack roots use wireImportsRecursively to auto-discover all .nix files recursively:
{flake, ...}: flake.inputs.autowire.wireImportsRecursively ./.
Subdirectories with a custom default.nix are treated as opaque — their default.nix is imported instead of recursing further. Adding a new .nix file to a pack directory automatically includes it.
Layered Composition
Configuration is built up in layers:
flake.nix— Declares all inputs; outputs generated viaflake-partsflake/*.nix— Flake-level glue (configs, formatter, activation). Each.nixfile is aflake-partsmodule imported byflake.nixpacks/{home,nixos}/— Autowired packs (common, host, container, gui). Import a pack, get everything in itmixins/{home,nixos}/— Opt-in configuration pieces (services, hardware, versions), manually imported by host configshome/*.nix— Per-user base Home Manager configurationsnixos/{hosts,containers}/— Per-host and per-container NixOS configurations
Custom Options
packs/home/common/options.nix defines the me option set used throughout Home Manager modules:
me.usernameme.fullnameme.email
These are set in each user’s base config (e.g., home/yjpark.nix).
Key Commands
Tasks are defined in mise.toml. Use mise tasks to list all available tasks.
Daily Use
# Home Manager activation (applies user-level config)
mise run _activate-home
# Build NixOS config for current host (builds without switching by default)
mise run build-host
# Switch NixOS config (applies system-level config, requires sudo)
mise run _switch-host
Flake Maintenance
# Update all flake inputs
mise run flake-update
# Update specific inputs
mise run flake-update nixpkgs home-manager
# Show flake outputs
mise run show
# Format Nix files (uses nixpkgs-fmt)
nix fmt
Documentation
# Serve docs locally (hot-reload)
mise run docs-serve
# Build static docs site
mise run docs-build
Nix Directly
# Activate Home Manager (same as mise run _activate-home)
nix run
# Build a specific package
nix build .#docs
Home Manager
User Profiles
Two user profiles exist in this configuration:
| Username | Used On | Base Config | State Version |
|---|---|---|---|
yjpark | Physical hosts | home/yjpark.nix | 25.05 |
yj | Containers | home/yj.nix | 26.05 |
Host and Container Mixins
Host-specific configurations live in:
mixins/home/hosts/— One.nixfile per physical hostmixins/home/containers/— One.nixfile per container
Adding a .nix file to either directory automatically registers a new host or container — no manual imports needed.
Activation Logic
flake/activate-home.nix defines how mise run _activate-home resolves the correct Home Manager configuration:
- Matches current hostname against known hosts → activates
yjpark@<host> - Matches current hostname against known containers → activates
yj@<host> - Falls back to bare
<username>for unknown hosts
Configuration Generation
flake/home-configs.nix generates username@host entries for each host/container mixin, plus a bare username fallback (without host suffix). This populates homeConfigurations in the flake outputs.
Secrets
Secrets are managed with SOPS-nix using age encryption.
Setup
- Each host has its own age key
- Encrypted secret files live in
secrets/directories and any files matchingsecret.* - The
.sops.yamlfile at the repo root defines which age keys can decrypt which secrets
Usage
Encrypted files are automatically decrypted at activation time by sops-nix and made available to NixOS/Home Manager modules as paths under /run/secrets/.
Refer to the sops-nix documentation for creating and editing secrets.
Flake Inputs
All inputs are declared in flake.nix. This page documents the purpose of each.
Core / Framework
| Input | Purpose |
|---|---|
nixpkgs | nixos-unstable — the primary package set |
home-manager | User environment management |
flake-parts | Flake composition framework |
jig | github:edger-dev/jig — provides autowire lib for auto-discovering and composing .nix files |
Software
| Input | Purpose |
|---|---|
sops-nix | Declarative secret management with SOPS + age |
nixvim | Neovim configured via Nix |
nixos-vscode-server | VS Code remote server support on NixOS |
solaar | Logitech device manager |
llm-agents | LLM agent tools |
Desktop / UI
| Input | Purpose |
|---|---|
claude-desktop | Claude desktop application |
niri | Wayland compositor |
xremap-flake | Key remapper for Wayland/X11 |
antigravity | (UI tool) |
jjui | TUI for the jj (Jujutsu) VCS |
Active Tasks
In Progress
Host monitoring: VictoriaMetrics + VictoriaLogs, per-site replicated hubs (flakes-f2ju)
Epic · normal · (5/8 done)
- ✓ Monitoring: shared topology module (hubs, roles, ports) (flakes-2gf7)
- ✓ Monitoring: VictoriaMetrics + VictoriaLogs hub on pc and edger (flakes-4c4d)
- ▶ Monitoring: MCP servers for agents (VictoriaMetrics + VictoriaLogs) (flakes-7o0r)
- ✓ Monitoring: node_exporter + vmagent dual-write on each host (flakes-c6gm)
- ○ Monitoring: optional Grafana dashboards (flakes-dbiv)
- ✓ Monitoring: journald → vlagent dual-write log shipping (flakes-m1as)
- ○ Monitoring: vmalert health rules (per-site, no double alerts) (flakes-me6e)
- ✓ Monitoring: per-service/per-process usage + vmui Hosts dashboard (flakes-szt9)
Container-first infrastructure (flakes-qbvb)
Epic · normal · (8/15 done)
- ○ lima->incus host-routable VM IP + self-healing route (macOS) (flakes-1huh)
- ○ Configure & run ZeroClaw (config, secrets, service) (flakes-8itl)
- ✓ Migrate container IPs to new scheme (flakes-cjao)
- ✓ Drop nixos-unified, use raw flake-parts (flakes-dght)
- ▶ Restructure lan mixins: per-site LANs plus separate cn concerns (flakes-dw38)
- ✓ Route onecli container egress through host clash proxy (flakes-i9ao)
- ○ Declarative incus fleet management (flakes-ihxf)
- ▶ Replace k3s clash with declarative host mihomo service (flakes-k0sx)
- ✓ Fix CA cert injection to be declarative (flakes-krtw)
- ○ MCP OAuth: browser-open + callback forwarding (desktop + WSL) (flakes-mqe9)
- ○ Package beans-serve (web UI) from source via nix (flakes-qe0o)
- ✓ Containerize OneCLI (flakes-t9u2)
- ✓ Setup SearXNG search for agents (flakes-woco)
- ✓ Cross-container MCP OAuth callback bridge (flakes-wq6s)
- ✓ Container-to-host network isolation (flakes-x821)
Todo
Host monitoring: VictoriaMetrics + VictoriaLogs, per-site replicated hubs (flakes-f2ju)
Epic · normal · (5/8 done)
- ✓ Monitoring: shared topology module (hubs, roles, ports) (flakes-2gf7)
- ✓ Monitoring: VictoriaMetrics + VictoriaLogs hub on pc and edger (flakes-4c4d)
- ▶ Monitoring: MCP servers for agents (VictoriaMetrics + VictoriaLogs) (flakes-7o0r)
- ✓ Monitoring: node_exporter + vmagent dual-write on each host (flakes-c6gm)
- ○ Monitoring: optional Grafana dashboards (flakes-dbiv)
- ✓ Monitoring: journald → vlagent dual-write log shipping (flakes-m1as)
- ○ Monitoring: vmalert health rules (per-site, no double alerts) (flakes-me6e)
- ✓ Monitoring: per-service/per-process usage + vmui Hosts dashboard (flakes-szt9)
Container-first infrastructure (flakes-qbvb)
Epic · normal · (8/15 done)
- ○ lima->incus host-routable VM IP + self-healing route (macOS) (flakes-1huh)
- ○ Configure & run ZeroClaw (config, secrets, service) (flakes-8itl)
- ✓ Migrate container IPs to new scheme (flakes-cjao)
- ✓ Drop nixos-unified, use raw flake-parts (flakes-dght)
- ▶ Restructure lan mixins: per-site LANs plus separate cn concerns (flakes-dw38)
- ✓ Route onecli container egress through host clash proxy (flakes-i9ao)
- ○ Declarative incus fleet management (flakes-ihxf)
- ▶ Replace k3s clash with declarative host mihomo service (flakes-k0sx)
- ✓ Fix CA cert injection to be declarative (flakes-krtw)
- ○ MCP OAuth: browser-open + callback forwarding (desktop + WSL) (flakes-mqe9)
- ○ Package beans-serve (web UI) from source via nix (flakes-qe0o)
- ✓ Containerize OneCLI (flakes-t9u2)
- ✓ Setup SearXNG search for agents (flakes-woco)
- ✓ Cross-container MCP OAuth callback bridge (flakes-wq6s)
- ✓ Container-to-host network isolation (flakes-x821)
Bootstrap home-manager on x1 WSL (Ubuntu) (flakes-tnjz)
Task · normal
Done (20)
Install latest beans via nix flake (flakes-6ne0)
Task · normal
Remove spacebot and hermes containers (flakes-7g5s)
Task · normal
Move p2 host to site 102 (flakes-cva3)
Task · normal
Start display manager on monitor hotplug (flakes-ilml)
Feature · normal
Remove k3s from all hosts (flakes-itu2)
Task · normal
Install Zeroclaw (flakes-kj17)
Task · normal
Unify incus container image build tasks (flakes-p8hf)
Task · normal
Remove rtk setup (flakes-pzk7)
Task · normal
All Tasks
Epics
- Host monitoring: VictoriaMetrics + VictoriaLogs, per-site replicated hubs (flakes-f2ju) — Todo
- Monitoring: shared topology module (hubs, roles, ports) (flakes-2gf7) — Done
- Monitoring: VictoriaMetrics + VictoriaLogs hub on pc and edger (flakes-4c4d) — Done
- Monitoring: MCP servers for agents (VictoriaMetrics + VictoriaLogs) (flakes-7o0r) — In Progress
- Monitoring: node_exporter + vmagent dual-write on each host (flakes-c6gm) — Done
- Monitoring: optional Grafana dashboards (flakes-dbiv) — Todo
- Monitoring: journald → vlagent dual-write log shipping (flakes-m1as) — Done
- Monitoring: vmalert health rules (per-site, no double alerts) (flakes-me6e) — Todo
- Monitoring: per-service/per-process usage + vmui Hosts dashboard (flakes-szt9) — Done
- Container-first infrastructure (flakes-qbvb) — Todo
- lima->incus host-routable VM IP + self-healing route (macOS) (flakes-1huh) — Draft
- Configure & run ZeroClaw (config, secrets, service) (flakes-8itl) — Draft
- Migrate container IPs to new scheme (flakes-cjao) — Done
- Drop nixos-unified, use raw flake-parts (flakes-dght) — Done
- Restructure lan mixins: per-site LANs plus separate cn concerns (flakes-dw38) — In Progress
- Route onecli container egress through host clash proxy (flakes-i9ao) — Done
- Declarative incus fleet management (flakes-ihxf) — Draft
- Replace k3s clash with declarative host mihomo service (flakes-k0sx) — In Progress
- Fix CA cert injection to be declarative (flakes-krtw) — Done
- MCP OAuth: browser-open + callback forwarding (desktop + WSL) (flakes-mqe9) — Todo
- Package beans-serve (web UI) from source via nix (flakes-qe0o) — Draft
- Containerize OneCLI (flakes-t9u2) — Done
- Setup SearXNG search for agents (flakes-woco) — Done
- Cross-container MCP OAuth callback bridge (flakes-wq6s) — Done
- Container-to-host network isolation (flakes-x821) — Done
Features
- Project-wise pane configuration in Zellij (flakes-1zlj) — Done ·
archived - Deploy OneCLI as credential proxy for yolo container (flakes-2aqm) — Done ·
archived - Host Caddy LAN proxy for Incus container services (flakes-68h7) — Done ·
archived - Incus container ingress auto-discovery (flakes-7ckd) — Done ·
archived - Ingress hub page: service dashboard with iframe embedding (flakes-bti9) — Done ·
archived - Extract ingress hub scripts for Ubuntu compatibility (flakes-d4np) — Done ·
archived - Monitoring: optional Grafana dashboards (flakes-dbiv) — Todo
- Change Zellij pane background color based on project path (flakes-dkc4) — Done ·
archived - Host-level ingress hub: one page per host for all service URLs (flakes-i4ol) — In Progress
- Route onecli container egress through host clash proxy (flakes-i9ao) — Done
- Declarative incus fleet management (flakes-ihxf) — Draft
- Start display manager on monitor hotplug (flakes-ilml) — Done
- Zellij WASM plugin for dynamic tab naming (flakes-je55) — Draft
- Replace k3s clash with declarative host mihomo service (flakes-k0sx) — In Progress
- MCP OAuth: browser-open + callback forwarding (desktop + WSL) (flakes-mqe9) — Todo
- Niri config: declarative host-based mixin (flakes-p2qs) — Done ·
archived - Add mdBook documentation site (flakes-px5o) — Done ·
archived - Fish functions for jj workspace management (flakes-rhqy) — Done ·
archived - Monitoring: per-service/per-process usage + vmui Hosts dashboard (flakes-szt9) — Done
- Zellij per-project auto-layouts on cd (flakes-u0yw) — Done ·
archived - Setup SearXNG search for agents (flakes-woco) — Done
- Cross-container MCP OAuth callback bridge (flakes-wq6s) — Done
- Reach pc ingress services without ZeroTier (flakes-xv5g) — Draft
- Add git worktree support to workspace commands (flakes-y87y) — Done ·
archived
Tasks
- Disable terminal bell sound (flakes-0u0f) — Done ·
archived - Create mise-run-or-just fish function (flakes-0ycg) — Done ·
archived - Enhance tv-mise-tasks to handle tasks with arguments (flakes-14he) — Done ·
archived - Make j abbreviation expand conditionally to mise run or just (flakes-1cc9) — Done ·
archived - lima->incus host-routable VM IP + self-healing route (macOS) (flakes-1huh) — Draft
- Expose pc ingress hub via Cloudflare tunnel as hub_pc.yjpark.org (flakes-2ab4) — Done
- Convert onecli-reseed to a manually-invoked script (flakes-2ey6) — Done
- Tidy up the shell title when running zellij (flakes-2fpy) — Done ·
archived - Monitoring: shared topology module (hubs, roles, ports) (flakes-2gf7) — Done
- Expose edger ingress hub via Cloudflare tunnel as hub_edger.yjpark.org (flakes-30pz) — Done
- Monitoring: VictoriaMetrics + VictoriaLogs hub on pc and edger (flakes-4c4d) — Done
- Remove stateVersion mixin pattern, use defaults instead (flakes-5pbu) — Done ·
archived - Restructure home config host/container registration (flakes-6n5b) — Done ·
archived - Install latest beans via nix flake (flakes-6ne0) — Done
- Resolve username from host/container dir in activate-home.nix (flakes-7aac) — Done ·
archived - Remove spacebot and hermes containers (flakes-7g5s) — Done
- Setup markdown-oxide (flakes-7ih3) — Done ·
archived - Monitoring: MCP servers for agents (VictoriaMetrics + VictoriaLogs) (flakes-7o0r) — In Progress
- Configure & run ZeroClaw (config, secrets, service) (flakes-8itl) — Draft
- Automate OneCLI CA push to containers on boot (flakes-aurl) — Done ·
archived - Set up Incus across machines (flakes-bxl7) — Done ·
archived - Auto-trigger tab completion after j abbr expands to mise run _ (flakes-c03b) — Done ·
archived - Monitoring: node_exporter + vmagent dual-write on each host (flakes-c6gm) — Done
- Migrate container IPs to new scheme (flakes-cjao) — Done
- Move p2 host to site 102 (flakes-cva3) — Done
- Expose kudo on pc via Cloudflare tunnel as kudo_pc.yjpark.org (flakes-d9tk) — Draft
- Drop nixos-unified, use raw flake-parts (flakes-dght) — Done
- Restructure lan mixins: per-site LANs plus separate cn concerns (flakes-dw38) — In Progress
- Ingress hub on p2, exposed as hub_p2.yjpark.org (flakes-gb22) — Draft
- Unify terminal theme to Tokyo Night (flakes-hncv) — Done ·
archived - Remove k3s from all hosts (flakes-itu2) — Done
- Replace autowire.nix with jig lib (flakes-iymi) — Done ·
archived - wezterm: Claude Code editing ergonomics (shipped) (flakes-jkwu) — Done
- Set up firewalld as NixOS service and migrate existing firewall rules (flakes-jvmx) — Done ·
archived - Setup quartz to preview and publish oxide projects (flakes-k391) — Draft
- Check MCPVault, to see whether it’s a better option for the markdowns (flakes-k3pr) — Done
- Install Zeroclaw (flakes-kj17) — Done
- Fix CA cert injection to be declarative (flakes-krtw) — Done
- Monitoring: journald → vlagent dual-write log shipping (flakes-m1as) — Done
- Monitoring: vmalert health rules (per-site, no double alerts) (flakes-me6e) — Todo
- Update CLAUDE.md to reflect current state (flakes-nyvs) — Done ·
archived - Setup colima with incus (flakes-o04s) — Done ·
archived - Add edit-in-place script (flakes-oh4v) — Done ·
archived - Add GitHub token via OneCLI + container git config (flakes-oi2x) — Done ·
archived - Refactor ai.nix into ai/ directory (flakes-ojyn) — Done ·
archived - Host-desktop: callback forward + xdg-open auto-open (flakes-ok62) — Todo
- MITM egress-proxy CLI: stable CA + ease-of-use (reference) (flakes-p2dp) — Draft
- Configure jjui theme for readability with Pencil Dark terminal theme (flakes-p7hc) — Done ·
archived - Unify incus container image build tasks (flakes-p8hf) — Done
- Add Cloudflare MCP server to Claude settings (flakes-pbel) — Done
- Setup OpenCode and Claude for spacebot container (flakes-pr3i) — Done
- Remove rtk setup (flakes-pzk7) — Done
- WSL: callback forward + wslview auto-open (flakes-q3l5) — In Progress
- Package beans-serve (web UI) from source via nix (flakes-qe0o) — Draft
- Integrate Home Manager as a NixOS module (flakes-rg27) — Done ·
archived - Migrate from just to mise for task running (flakes-rg2j) — Done ·
archived - Trial MCPVault as an MCP server for the notes vault (flakes-rv2o) — Draft
- Full jjui theme with terminal-independent hex colors (flakes-sk2r) — Done ·
archived - Containerize OneCLI (flakes-t9u2) — Done
- Bootstrap home-manager on x1 WSL (Ubuntu) (flakes-tnjz) — Todo
- Inhibit idle/sleep during audio/video playback (flakes-va02) — Done ·
archived - Dynamic per-host Home Manager configs via flake module (flakes-vaiq) — Done ·
archived - Phase A: container browser-open script (OSC) (flakes-vzo1) — Done
- pc: move /home to dedicated ext4 disk (nvme0n1) (flakes-wabt) — Done
- Remove k3s from g1 (offline during flakes-itu2) (flakes-x7wb) — Todo
- Container-to-host network isolation (flakes-x821) — Done
- Add rtk-rewrite.sh hook to claude module with home-manager linking (flakes-y887) — Done ·
archived - Replace CopyQ with cliphist (Wayland-native clipboard manager) (flakes-yyox) — Done ·
archived - Add mdbook-beans tasks section to docs (flakes-zvh8) — Done ·
archived
Bugs
- Fix llm-agents binary cache not being applied; drop dead ai trail (flakes-162n) — Done
- Fix Ctrl+Shift+C in wezterm clobbering zellij clipboard (flakes-5oyz) — Done ·
archived - Container switches revert on reboot (lxc-container module missing) (flakes-dnjc) — Done
- Auto-restart firewalld when zone config changes (flakes-ja9k) — Done
- Fix mise.toml var args bug (flakes-m3r8) — Done ·
archived - Fix git push auth inside Incus container via OneCLI proxy (flakes-nz9y) — Done ·
archived - Pass currentSystem to NixOS-integrated home-manager extraSpecialArgs (flakes-sytx) — Done
- nix-daemon: route cache.nixos.org through proxy (flakes-wsls) — In Progress
Drafts
- lima->incus host-routable VM IP + self-healing route (macOS) (flakes-1huh) — Draft
- Configure & run ZeroClaw (config, secrets, service) (flakes-8itl) — Draft
- Expose kudo on pc via Cloudflare tunnel as kudo_pc.yjpark.org (flakes-d9tk) — Draft
- Ingress hub on p2, exposed as hub_p2.yjpark.org (flakes-gb22) — Draft
- Declarative incus fleet management (flakes-ihxf) — Draft
- Zellij WASM plugin for dynamic tab naming (flakes-je55) — Draft
- Setup quartz to preview and publish oxide projects (flakes-k391) — Draft
- MITM egress-proxy CLI: stable CA + ease-of-use (reference) (flakes-p2dp) — Draft
- Package beans-serve (web UI) from source via nix (flakes-qe0o) — Draft
- Trial MCPVault as an MCP server for the notes vault (flakes-rv2o) — Draft
- Reach pc ingress services without ZeroTier (flakes-xv5g) — Draft
Epics
- Host monitoring: VictoriaMetrics + VictoriaLogs, per-site replicated hubs (flakes-f2ju) — Todo
- Container-first infrastructure (flakes-qbvb) — Todo
Host monitoring: VictoriaMetrics + VictoriaLogs, per-site replicated hubs (flakes-f2ju)
Monitor the always-on hosts (initially pc @ site 102 and edger @ site 401): host health, systemd unit state, and service logs, with a web UI and an API/MCP surface for agents.
Decisions (2026-10-07)
- Stack: VictoriaMetrics + VictoriaLogs. Chosen over Beszel (no logs), Netdata (heavier, modern UI unfree/cloud-leaning) and Grafana+Prometheus+Loki (heaviest). Both have NixOS modules in our nixpkgs (
services.victoriametrics,services.victorialogsv1.49). - Topology: one hub per site, replicated (dual-write). pc is the hub for 102, edger for 401. Every monitored host runs agents that write to all hubs, so each hub holds the full dataset:
- per-site autonomy when the zerotier link is down;
- agents buffer to disk per remote URL and replay on reconnect (no gaps);
- any hub answers queries for every host (UI/API/MCP can point at either).
- Rejected: query-time federation (store once, fan-out via vmselect/vlselect or multi-datasource) — more moving parts, cross-site view lost when link down, only pays off at scale.
- Access: zerotier only. No cloudflared exposure. zerotier (172.22.0.0/16) is already in the firewalld
trustedzone (packs/nixos/host/zerotier/zerotierone.nix); bind on 0.0.0.0 or zerotier IP, do not open inlan/public zones unless needed. - Grafana: later, optional — start with built-in vmui (VM) and the VictoriaLogs web UI (
/select/vmui).
Data flow
each host
node_exporter (systemd collector) ──scrape── vmagent ──remoteWrite──▶ VM @ pc, VM @ edger
systemd-journal-upload ──▶ vlagent (local, /insert/journald) ──remoteWrite──▶ VL @ pc, VL @ edger
hub (pc, edger)
victoriametrics :8428 (vmui at /vmui)
victorialogs :9428 (UI at /select/vmui)
MCP server(s) for agents
Verified facts
vlagentreusesvlinsert.RequestHandler, so it accepts/insert/journald/directly (source: VictoriaLogs v1.49app/vlagent/main.go,app/vlinsert/main.go).-remoteWrite.urlis repeatable with per-URL disk queues.- nixpkgs
victorialogsbuilds vlagent only withwithVlAgent = trueoverride; there is no NixOS module for vlagent → custom systemd unit. - nixpkgs
services.vmagenthas a singleremoteWrite.url; extra URLs viaextraArgs. services.journald.uploadexists (systemd-journal-upload, single URL → point at local vlagent).mcp-grafanais packaged; the officialmcp-victoriametrics/mcp-victorialogsare not — need packaging.
Children
See child beans for: shared monitoring module, hub, metrics agent, log shipping, MCP, and Grafana follow-up.
Container-first infrastructure (flakes-qbvb)
Migrate services to containers, isolate host, restructure Nix config.
IP Scheme
10.100.0.1 host (bridge)
10.100.0.2+ infra containers
.002 onecli
.003 searxng
10.100.0.100+ agent containers
.100 yolo
.101 spacebot
.102 hermes
10.100.0.200+ scratch
.200 ubuntu
Architecture
- Host becomes thin bridge: Caddy ingress, dnsmasq, SOPS secrets, onecli-seeder
- OneCLI moves to its own container
- SearXNG in its own container
- Container→host traffic blocked (except DHCP/DNS) via nftables
- Container↔container unrestricted on bridge
- Secret flow: Host SOPS → seeder calls OneCLI API at .002 → pushes proxy-auth/CA to agent containers
- CA cert injection made declarative via security.pki.certificateFiles
- Drop nixos-unified for raw flake-parts (separate host/container config namespaces)
Features
- Project-wise pane configuration in Zellij (flakes-1zlj) — Done ·
archived - Deploy OneCLI as credential proxy for yolo container (flakes-2aqm) — Done ·
archived - Host Caddy LAN proxy for Incus container services (flakes-68h7) — Done ·
archived - Incus container ingress auto-discovery (flakes-7ckd) — Done ·
archived - Ingress hub page: service dashboard with iframe embedding (flakes-bti9) — Done ·
archived - Extract ingress hub scripts for Ubuntu compatibility (flakes-d4np) — Done ·
archived - Monitoring: optional Grafana dashboards (flakes-dbiv) — Todo
- Change Zellij pane background color based on project path (flakes-dkc4) — Done ·
archived - Host-level ingress hub: one page per host for all service URLs (flakes-i4ol) — In Progress
- Route onecli container egress through host clash proxy (flakes-i9ao) — Done
- Declarative incus fleet management (flakes-ihxf) — Draft
- Start display manager on monitor hotplug (flakes-ilml) — Done
- Zellij WASM plugin for dynamic tab naming (flakes-je55) — Draft
- Replace k3s clash with declarative host mihomo service (flakes-k0sx) — In Progress
- MCP OAuth: browser-open + callback forwarding (desktop + WSL) (flakes-mqe9) — Todo
- Niri config: declarative host-based mixin (flakes-p2qs) — Done ·
archived - Add mdBook documentation site (flakes-px5o) — Done ·
archived - Fish functions for jj workspace management (flakes-rhqy) — Done ·
archived - Monitoring: per-service/per-process usage + vmui Hosts dashboard (flakes-szt9) — Done
- Zellij per-project auto-layouts on cd (flakes-u0yw) — Done ·
archived - Setup SearXNG search for agents (flakes-woco) — Done
- Cross-container MCP OAuth callback bridge (flakes-wq6s) — Done
- Reach pc ingress services without ZeroTier (flakes-xv5g) — Draft
- Add git worktree support to workspace commands (flakes-y87y) — Done ·
archived
Project-wise pane configuration in Zellij (flakes-1zlj)
Configure Zellij pane/tab naming to visually identify projects in multi-project sessions.
Design
State Management
- State file:
/tmp/zellij-tab-{ZELLIJ_SESSION_NAME}— one line per pane:{PANE_ID}={project_name} - Session root: Capture
$PWDat shell init asZELLIJ_SESSION_PROJECT— the “home” project for the session - Project name: Git repo root basename (
git rev-parse --show-toplevel | basename), fallback tobasename $PWD
Pane Name Behavior
| Condition | Pane name |
|---|---|
| PWD is within session’s starting project | {command} (current behavior) |
| PWD is in a different project | <{project}> {command} |
| Idle (no running command) | <{project}> or empty (current behavior) |
Updated in fish_preexec (command starts) and on PWD change.
Tab Name Behavior
On every PWD change in any pane:
- Write/update own entry in the state file
- Read all entries, collect unique project names
- If only one unique project:
rename-tab "{project}"(same as today) - If multiple:
rename-tab "{project1} | {project2} | ..."
Cleanup
fish_exitevent: Remove own pane entry from state file, rebuild tab name- Shell init: Prune entries whose pane IDs are no longer in the state file
Tasks
- Add helper to resolve project name (git root basename, fallback to basename PWD)
- Capture session project on shell init ($ZELLIJ_SESSION_PROJECT)
- Implement state file writes (per-pane project tracking)
- Update pane name logic: <project> command format when outside session project
- Update tab name logic: aggregate unique projects from state file
- Add cleanup on fish_exit
- Add stale entry pruning on shell init (simplified: natural overwrite on pane ID reuse)
Summary of Changes
Implemented in modules/home/programs/fish/init/zellij.fish:
zellij_project_name: resolves git repo root basename, fallback to basename PWDZELLIJ_SESSION_PROJECT: captured at shell init to detect foreign projects- State file (
/tmp/zellij-tab-{SESSION}): per-pane project tracking, scoped by session name - Pane names:
<project> commandwhen in foreign project, justcommandotherwise - Tab names: aggregated unique projects in pane order, joined with
| - Cleanup on
fish_exitremoves pane entry and rebuilds tab name
Deploy OneCLI as credential proxy for yolo container (flakes-2aqm)
Set up OneCLI (MITM proxy) on edger host to inject API keys for agents running in the yolo Incus LXC container. Agents get placeholder keys; OneCLI injects real credentials at the network layer.
Tasks
- Create mixins/nixos/services/onecli.nix (OCI containers + seeder service)
- Create mixins/nixos/services/secrets/onecli-secrets.txt (sops-encrypted)
- Modify configurations/nixos/edger/imports.nix (enable onecli)
- Modify mixins/home/ai/tools/claude-mcp-add-context7.bash (use placeholder key)
- Modify mixins/home/host/linux/scripts/incus/incus-launch-yolo.bash (push CA cert)
context7 Rule Fix
- Update seeder to use per-secret config (hostPattern + headerName + valuePrefix)
- Add CONTEXT7_API_KEY entry targeting context7.com with Authorization: Bearer injection
Proxy Auth & CA Trust Fixes
- Use agent token (aoc_ prefix) instead of user API key (oc_ prefix) for proxy auth
- Set /etc/onecli-proxy-auth to mode 644 so non-root users can read it
- Append OneCLI CA to existing CA bundles (handles Nix store symlinks)
- Add fish shell proxy config via Home Manager shellInit
- Guard onecli-seed-secrets in mise tasks for hosts without OneCLI
- Add verbose diagnostics to onecli-check-proxy script
Summary of Changes
Fixed three root causes preventing OneCLI proxy injection in containers:
- Wrong API key type — gateway expects agent tokens (aoc_), not user keys (oc_)
- CA trust — appended OneCLI CA directly to active CA bundles instead of using security.pki (which fails at Nix build time)
- Fish shell — profile.d scripts aren’t sourced by fish; moved proxy var setup to Home Manager’s programs.fish.shellInit
Host Caddy LAN proxy for Incus container services (flakes-68h7)
Add host-level Caddy reverse proxy to expose Incus container services to ZeroTier LAN via *.hostname.yjpark.org with Let’s Encrypt certs (Cloudflare DNS-01). Domain pattern: yolo-8080.edger.yjpark.org → http://10.100.0.100:8080.
Summary of Changes
Modified mixins/nixos/host/incus-ingress.nix:
- Added
pkgs.caddy.withPluginswith the Cloudflare DNS plugin (hash pinned tosha256-bL1cpMvDogD/...) - Added Caddyfile generation: HTTPS + HTTP fallback blocks, per-container
host_regexpmatchers - Added
sops.secrets."cloudflare-caddy-env"declaration pointing to./secrets/cloudflare-caddy.txt - Added
systemd.services.caddy.serviceConfig.EnvironmentFilefor the SOPS secret path - Added
services.firewalld.zones.public.services = ["http" "https"]
Pending user action: create mixins/nixos/host/secrets/cloudflare-caddy.txt as a SOPS-encrypted dotenv file containing CLOUDFLARE_API_TOKEN=<token>.
Incus container ingress auto-discovery (flakes-7ckd)
Caddy reverse proxy inside container that auto-discovers listening ports and serves them via hostname routing (e.g. https://3000.yolo.incus). Includes ingress and ingress-sync shell commands.
Ingress hub page: service dashboard with iframe embedding (flakes-bti9)
A hub web page served inside each container that auto-discovers running services and presents them as a navigable list with iframe embedding. Built on existing Caddy + ingress-sync infrastructure.
Design
Overview
Single hub page per container at hub.<hostname>.incus — left sidebar lists discovered services, right pane shows selected service in an iframe.
Service Discovery
Extend existing generate-ingress-config script to also produce /var/lib/ingress/services.json:
ss -tlnp→ port + PID + process name (existing logic)readlink /proc/<pid>/cwd→ working directory (new)- Shorten cwd (strip home prefix, show last 1-2 path segments)
- Output format:
[{"port": 3000, "process": "node", "cwd": "my-app", "url": "https://3000.hostname.incus"}] - Hub port excluded from the list (avoid self-reference)
Hub Page (Caddy Templates)
- Static HTML file with embedded CSS/JS, served by Caddy
templatesdirective - JS fetches
services.jsonat load time - Left sidebar: service list showing
<short_path> <process> :<port> - Right pane: iframe loading selected service URL
- Iframe failure detection → fallback “open in new tab” link
Caddy Config Changes
- New route:
hub.<hostname>.incusserving the hub HTML +services.json - Strip
X-Frame-Optionsand rewriteContent-Security-Policyheaders on all proxied routes (enables iframe embedding) - Internal TLS unchanged
Nix Integration
- All changes in
mixins/nixos/container/ingress.nix - Hub HTML as a Nix file/package
ingress-syncregenerates both Caddy config andservices.jsoningresscommand unchanged
Tasks
- Extend
generate-ingress-configto read/proc/<pid>/cwdand writeservices.json - Create hub HTML template (sidebar + iframe layout, JS service loader, iframe error fallback)
- Add Caddy route for
hub.<hostname>.incusserving hub page + services.json - Strip X-Frame-Options/CSP headers on proxied routes
- Test with multiple running services
Not in v1
- Manual label overrides
- Cross-container aggregation (host-level hub)
- Auto-refresh on service change (manual page reload for now)
- Service grouping/categorization
Summary of Changes
Implemented ingress hub page for container service dashboard:
- Hub page served at
hub.<hostname>.incus(internal) and<container>-hub.<host>.yjpark.org(external) - Service discovery via
ss -tlnpwith process name and working directory from/proc/<pid>/cwd - Sidebar + iframe layout with resizable sidebar, compact mode (icon toolbar), and service list sorted by port
- Smart URL routing: uses
https://<container>-<port>.<host>.yjpark.org(real LE certs) when accessed externally,http://<port>.<hostname>.incusinternally - Sync button triggers
generate-ingress-configvia Python API, showsingressstatus output in dismissable modal - Favicon proxy at
/api/icon/<port>fetches favicons from services (tries/favicon.icothen parses HTML<link rel=icon>), falls back to colored letter icons - Header stripping: removes
X-Frame-OptionsandContent-Security-Policyon proxied routes for iframe embedding - Host ingress: added
<container>-hubroute toincus-ingress.nixfor external access
Files changed:
mixins/nixos/container/ingress.nix— hub HTML, sync API, enhanced generate-ingress-configmixins/nixos/services/incus-ingress.nix— hub route for host-level Caddy
Extract ingress hub scripts for Ubuntu compatibility (flakes-d4np)
Extract scripts from mixins/nixos/container/ingress.nix into standalone files under mixins/home/container/ingress/, refactor NixOS module to reference them, and add ubuntu-setup-ingress.bash for Ubuntu container support.
Tasks
- Extract hub-index.html from ingress.nix
- Extract generate-ingress-config.bash
- Extract ingress-sync-api.py
- Extract ingress.bash (status script)
- Extract ingress-sync.bash
- Create mixins/home/container/ingress/default.nix (Nix packages)
- Refactor mixins/nixos/container/ingress.nix to use shared scripts
- Create ubuntu-setup-ingress.bash
Summary of Changes
Extracted inline scripts from the NixOS module into standalone files:
- Scripts live in
mixins/home/container/ingress/(source of truth) - Copies in
mixins/nixos/container/ingress-scripts/(needed due to Nix flake autowire boundaries) - NixOS module refactored to use
builtins.readFileon local copies - Home Manager module adds scripts to PATH via
home.packages ubuntu-setup-ingress.bashhandles apt packages, systemd units, dnsmasq, resolved, sudo rules- All three configs (yolo, yolo-lima, home/yj) evaluate successfully
Monitoring: optional Grafana dashboards (flakes-dbiv)
Optional richer dashboards once the built-in vmui/VL UIs feel limiting.
Spec
services.grafanaon hub(s), declaratively provisioned datasources: VictoriaMetrics (Prometheus type or VM plugin) and VictoriaLogs (victoriametrics-logs-datasourceplugin).- Provision Node Exporter Full dashboard + a per-host overview.
- Consider
mcp-grafana(packaged in nixpkgs) as an alternative agent surface. - Zerotier-only, same as the rest.
Todo
- Grafana with provisioned datasources + dashboards
Change Zellij pane background color based on project path (flakes-dkc4)
Visually distinguish panes belonging to different projects by assigning each project a unique background color in Zellij. Builds on the project-wise pane naming from flakes-1zlj.
Design
Palette
8 subtle Gruvbox-adjacent background tints (base bg is #282828):
| Index | Hex | Tint |
|---|---|---|
| 0 | #2e1a1a | Red |
| 1 | #1a2e1a | Green |
| 2 | #1a1a2e | Blue |
| 3 | #2e2e1a | Yellow |
| 4 | #2e1a2e | Magenta |
| 5 | #1a2e2e | Cyan |
| 6 | #2e241a | Orange |
| 7 | #1a2e24 | Teal |
Color Assignment
- Hash project name (simple checksum) mod palette size → deterministic color index
- Same project always gets the same color
- Known limitation: hash collisions possible, acceptable for now
Behavior
- Home project (
ZELLIJ_SESSION_PROJECT): no color change, stays at terminal default - Foreign project: apply palette color via
zellij action set-pane-color --bg - On return to home project:
zellij action set-pane-color --reset - Applied on PWD change and shell init
Files Changed
modules/home/programs/fish/init/zellij.fish only.
Tasks
- Add color palette array
- Add hash function for project name → palette index
- Add
zellij_update_pane_colorfunction - Integrate into PWD hook and init block
- Reset color when returning to home project
Summary of Changes
Added to modules/home/programs/fish/init/zellij.fish:
ZELLIJ_PANE_COLORS: 8 subtle Gruvbox-adjacent bg tintszellij_project_color_index: djb2-style hash mod palette size, returns stable integer indexzellij_update_pane_color: applies color for foreign projects, resets for home project- Called from PWD hook and init block alongside existing pane/tab name updates
Host-level ingress hub: one page per host for all service URLs (flakes-i4ol)
One place per host to find every service URL: hub.<host>.yjpark.org lists the host’s own web UIs (VictoriaMetrics, VictoriaLogs, clash, onecli), copyable MCP endpoints, the live listening ports of every incus container, and the other site’s hub. Replaces the per-container hub pages (hub.<c>.incus / <c>-hub.<host>.yjpark.org). Supersedes the “host-level hub” left out of flakes-bti9.
Scoped down from a Rust edger/hub links connector, which would conflict with the next stage of edger.
Design
Containers (packs/nixos/container/ingress.nix)
- Static Caddyfile, no generator: host regex
^(\d+)\.<c>\.incus$→localhost:<port>, strip X-Frame-Options/CSP; HTTPS (tls internal) + HTTP. Still needed: dev servers bind 127.0.0.1, and agents use<port>.<c>.incusto test. - Removed: generate-ingress-config, ingress-sync, ingress-sync-api, hub-index.html, services.json, hub dir, ingress-sync sudo rule.
- Kept:
ingressstatus command (listening ports + URLs). - MCP OAuth bridge site moves to
mcp-oauth-bridge.nixas its own unit. - Caddy internal CA → bundle merge becomes a oneshot after caddy.
Hosts (mixins/nixos/services/incus-ingress.nix, pc + edger)
ingress.containers—{name, ip}list option.ingress.services.<name> = { title; group; upstream ? null; path ? "/"; url ? null; note ? null; }— withupstream:<name>.<host>.yjpark.orgCaddy route (frame headers stripped), opened in the iframe; without: copy-only row (MCP).ingress.sitesdefault[ "pc" "edger" ], self filtered out.- Contributions: monitoring/hub.nix (
vm,logs), monitoring/mcp.nix (two MCP rows), clash (clash,/ui/), onecli (onecli, replaces the hand-written route). hub.<host>.yjpark.org:/page,/links.json(Nix-generated),/api/*→ hub API.<c>-<port>.<host>.yjpark.orgunchanged;<c>-hubroutes and dead/s/<port>/routes removed.- Hub API (Python, 127.0.0.1, own user in incus-admin):
GET /api/containersrunsincus exec -T <c> -- ss -tlnp+ cwd per running container, per-container errors;GET /api/icon/<c>/<port>favicon via<c-ip>:80Host<port>.<c>.incus.
Page
Sidebar groups: This host → one per container (live ports → https://<c>-<port>.<host>.yjpark.org) → Other sites (new tab). Keeps iframe pane, compact mode, resize.
Exposure
New subdomains share the existing <c>-<port> exposure (Caddy 80/443, firewalld public zone). Note: clash controller becomes reachable wherever host Caddy is.
Tasks
- Container: static Caddyfile, drop generator/hub/sync bits, keep
ingress - Container: MCP OAuth bridge unit, CA bundle oneshot
- Host: options (
containers,services,sites), Caddy routes, links.json - Host: hub API service
- Host: hub page with groups
- Register monitoring, MCP, clash, onecli services
- pc imports incus-ingress
- Evaluate/build pc, edger, yolo, onecli, searxng
- Deploy yolo in place, switch pc, verify page (onecli container unchanged, nothing to deploy)
- edger: switch later (with pending yolo update)
Notes (2026-10-17)
- onecli container runs no Caddy, so
ingress.containersentries carryviaCaddy; onecli ports are proxied to<ip>:<port>directly. - Single CA bundle builder in containers:
ingress.extraCaFiles(Caddy internal CA + OneCLI CA), rebuilt byingress-ca-bundle.{service,path}. Fixes the old race where the ingress generator and onecli-ca-bundle each dropped the other’s CA. - MCP OAuth bridge is now a socat unit (
mcp-oauth-bridge.service) bound to the container IP. - Caddy needs the clash proxy env on CN hosts for Let’s Encrypt (direct requests time out): added to
mixins/nixos/cn/proxy-env.nix. - Hub API needs a writable
$HOMEfor the incus client (StateDirectory=ingress-hub). - pc now runs systemd-resolved (pulled in by the ingress mixin), like edger.
- Verified on pc: hub, links.json, /api/containers, vm, logs, clash, onecli, onecli-10254 all 200 over HTTPS; unknown subdomains 404.
- Clash dashboard confirmed working in the browser via the hub link (
#/setup?hostname=clash.<host>.<domain>&port=443); metacubexd’s config.js defaults the backend to the page origin. - yolo redeployed with the final container config (
ingresshides 3118/12345).
Route onecli container egress through host clash proxy (flakes-i9ao)
OneCLI’s Rust gateway dials upstream services directly — it has no upstream
forward-proxy support (upstream issue https://github.com/onecli/onecli/issues/182,
still open, no maintainer response, no PR). Setting HTTPS_PROXY in
virtualisation.oci-containers.containers.onecli.environment
(nixos/containers/onecli/service.nix) therefore does not affect gateway
egress.
On CN-side hosts the only route to the internet is the clash proxy running as a
k3s NodePort, so the onecli container cannot reach upstream APIs at all. Fixed
below the application: an nftables REDIRECT captures the container’s outbound
TCP and hands it to a local mihomo instance that forwards to the host’s clash
proxy, rewriting each connection’s destination to the sniffed TLS SNI.
Chain: agent in yolo → onecli:10255 (injects credentials) → mihomo in the
onecli container → 10.100.0.1:31102 (host clash) → upstream.
Verified environment facts
- clash is a k3s NodePort in ns
services:31102→1102(http),31101→1101(socks5),31109→1109(control). - Both
pcandedgerrun k3s (via the autowiredmixins/nixos/ext4, which includesk3s.ext4.nix), so31102exists on both. incusbr0is10.100.0.1/24withipv4.nat = true, so from inside any incus container the host’s clash proxy is at10.100.0.1:31102.- firewalld backend is
nftablesandnetworking.nftables.enable = true(set bypacks/nixos/common/settings/firewalld.nix);networking.firewall.enable = false— firewalld replaces it. - The onecli container’s
system.stateVersionis26.05, sonetworking.nftables.flushRulesetdefaults to false — nftables.service only deletes the tables it declares and leaves firewalld’s ruleset intact. onecliis deployed onedger(nixos/hosts/edger/imports.nix);pcdoes not yet importmixins/nixos/services/onecliormixins/nixos/services/incus-ingress.nix.
Design decisions
- mihomo, not sing-box. The whole point is for the upstream clash to receive
CONNECT <domain>:443rather thanCONNECT <ip>:443, so that its domain rules still match and the container’s (poisoned) DNS answers become irrelevant. mihomo’ssniffer.override-destinationdoes exactly that. sing-box 1.13 cannot:sniff_override_destinationwas removed in 1.13.0, and the replacementaction: "sniff"only feeds route-rule matching. Verified empirically against sing-box 1.13.5 and mihomo 1.19.23 — see “Verification performed” below. - redsocks was rejected. It only ever issues
CONNECT <ip>:<port>, so clash’s domain rules would be bypassed and a separate clean-DNS story (local DoH resolver) would be mandatory. It is also a dead end in this repo: theservices.redsocksmodule applies its iptables rules vianetworking.firewall.extraCommands, which never runs because firewalld is used instead of the NixOS iptables firewall. redirect, nottun. A tun inbound would also catch UDP but needs/dev/net/tunadded to the container — an imperative step outside Nix.- No
meta skuidloop guard in the nftables rules: mihomo runs underDynamicUser, so its uid is unknowable at build time, and a name-basedskuidmatch fails the sandboxednetworking.nftables.checkRulesetbuild check. Excluding10.0.0.0/8covers mihomo’s own egress to the proxy. networking.enableIPv6 = falsein the mixin. The host proxy is IPv4 and only theipfamily is redirected, so leaving IPv6 on would let connections to dual-stack hosts silently bypass the proxy and hang. glibc prefers IPv4 over the incus ULA address by RFC 6724 precedence, but that is a preference, not a guarantee. Disabling IPv6 also makesgetaddrinfo’sAI_ADDRCONFIGdrop AAAA records so nothing even attempts IPv6.- No GEOIP/GEOSITE rules in the mihomo config: matching those makes mihomo fetch geodata, which it cannot do until the proxy it is configuring already works.
- Reusable mixin, so
searxng/ other containers can opt in later.
Verification performed
- Reproduced the whole data path on
pcbefore writing any Nix, using a throwaway nftables table (`ip daddr 198.51.100.7 tcp dport 443 redirect to - 12345
) plus a logging CONNECT proxy, andcurl –resolve example.com:443:198.51.100.7` so the destination IP was deliberately bogus:
- sing-box 1.13.5 with
action: "sniff"→ upstream receivedCONNECT 198.51.100.7:443— the IP. Destination override is gone. - sing-box 1.13.5 with legacy
sniff_override_destination: true→ refused to start: “legacy inbound fields are deprecated in sing-box 1.11.0 and removed in sing-box 1.13.0”. - mihomo 1.19.23 with
sniffer.override-destination: true→ upstream receivedCONNECT example.com:443. The bogus IP was discarded in favour of the sniffed SNI. - End-to-end against the real clash on
31102:http_code=200, and mihomo logged[TCP] ... --> example.com:443 match Match using upstream.
Build-time verification after implementation:
nixosConfigurations.onecli.config.system.build.toplevelbuilds, which includes the sandboxednetworking.nftables.checkRulesetvalidation of the generated ruleset.- The generated mihomo config passes
mihomo -t(“configuration file … test is successful”). pcandedgertoplevels still evaluate (nix build --dry-run), and both show31102/tcpinservices.firewalld.zones.incus.ports.
Summary of Changes
mixins/nixos/services/egress-proxy.nix (new)
Container-side mixin, parameterised via let bindings (proxyHost,
proxyPort, redirPort, directDests) in the style of
mixins/nixos/services/incus-ingress.nix:
services.mihomowith a generated config:redir-porton loopback,sniffer.override-destination: true(TLS:443, HTTP:80), a singlehttpproxy pointing at10.100.0.1:31102, andIP-CIDR ... DIRECT+MATCH,upstreamrules.networking.nftables.tables.egress-proxy— its owniptable with anat hook outputchain that returns for loopback / incus bridge / LAN / link-local / multicast and redirects all other TCP to the mihomo port.networking.enableIPv6 = false.
packs/nixos/host/incus.nix
Added { port = 31102; protocol = "tcp"; } to
services.firewalld.zones.incus.ports so containers can reach the host’s clash
NodePort. Applies to every host, which is the intent.
nixos/containers/onecli/imports.nix
Imports the new mixin.
nixos/containers/onecli/service.nix
podman-onecli now has after/wants on mihomo.service. The nftables
REDIRECT is installed before network-pre.target, so without this every
outbound connection during boot — including the ghcr.io/onecli/onecli:latest
image pull — is redirected to a closed port and refused.
Side benefit
The image pull and the curl calls in mixins/nixos/services/onecli/*.bash
now go through clash too; previously they went direct and would fail on
CN-side hosts.
Known limitation
Names that resolve to AAAA only will not work, since IPv6 is disabled and
the redirect is IPv4-only. None of the hosts OneCLI targets are in that
category (api.anthropic.com, github.com, context7.com all have A
records). If it ever matters, the fix is mihomo’s dns section in fake-ip
mode plus pointing the container’s resolv.conf at mihomo, which makes every
name resolve to a synthetic IPv4 that mihomo maps back to the domain.
Tasks
- Create
mixins/nixos/services/egress-proxy.nix - Open
31102/tcpinservices.firewalld.zones.incus(packs/nixos/host/incus.nix) - Import the mixin from
nixos/containers/onecli/imports.nix - Order
podman-onecliaftermihomo.service - Confirm the destination is rewritten to the sniffed domain, not the IP (mihomo 1.19.23 verified; sing-box 1.13.5 ruled out)
- Confirm no loop: mihomo’s own egress to
10.100.0.1:31102falls under the10.0.0.0/8exclusion - Build
nixosConfigurations.onecliincl. nftablescheckRuleset, andmihomo -tthe generated config - (done on
pc, 2026-10-15) Deploy toedgerand verify in situ:incus exec onecli -- curl -sS https://api.anthropic.comreaches upstream and clash logs the request by domain - Verify the gateway path end-to-end from
yolo(agent → onecli → mihomo → clash → upstream) - Check the boot-time ordering holds in practice (mihomo up before the image pull)
Deferred
pc host enablement of onecli needs mixins/nixos/services/onecli and
mixins/nixos/services/incus-ingress.nix added to nixos/hosts/pc/imports.nix,
which drags in the Caddy ingress, the Cloudflare secret and the 10.100.0.x
static-IP scheme. Worth its own bean.
Deploy notes (2026-10-15)
The onecli container was still running a pre-mihomo system, so after the k3s removal (471879b) its egress was dead and every agent container behind OneCLI lost HTTPS. Because onecli had no internet, deployed by building nixosConfigurations.onecli on edger, piping the missing closure in with nix-store --export | incus exec onecli -- nix-store --import, then nix-env -p /nix/var/nix/profiles/system --set + switch-to-configuration switch in the container. yolo was switched the same way.
Verified: curl from onecli and from yolo reaches github.com / api.anthropic.com; host mihomo logs show 10.100.0.2 and 10.100.0.100 connections by domain. mihomo logs Start Redir server error: operation not permitted - that is only the UDP redir listener (no permission in the container); the TCP listener on 127.0.0.1:12345 is up and is all the nftables rule uses.
podman-onecli was NOT restarted by the switch (only its unit ordering changed), so the boot-time ordering check is still open - needs a container restart.
Summary of Changes
Deployed and verified. Boot ordering after incus restart onecli: mihomo started at +676.59s, podman-onecli (and the image pull) at +676.78s; onecli and yolo egress both work after the reboot. The first restart attempt booted back into the old image system - fixed in flakes-dnjc.
Deployment on pc (2026-10-15)
- First real deploy exposed a bug: the nixpkgs mihomo module passes its config
via
LoadCredential, but inside the incus container the unit starts withoutCREDENTIALS_DIRECTORY, so mihomo looked for/config.yamland crash-looped. Fixed inegress-proxy.nixby forcingExecStartto read the store path and clearingLoadCredential. (edger’s in-place switch above did not hit this; it shows up when the container boots fresh from the image.) - Verified on a freshly launched onecli: mihomo + podman-onecli come up in order,
the image pull works, and
api.anthropic.comis reached via clash (the 403 region block is gone). From yolo: TLS through onecli OK, GitHub token injection OK. - onecli
:latestchanged the injection model: agents are “selective” and only get secrets they hold a grant for (PUT /api/agents/:id/grants/secrets/:sid).onecli-reseednow grants every secret to the default agent. The Auth.js/api/auth/sessionroute now 500s (MissingSecret) in local mode, so the scripts’ readiness probes use/api/user/api-keyinstead. - edger: if its onecli pulls a newer image, run
onecli-reseedthere too so the default agent gets its grants.
Declarative incus fleet management (flakes-ihxf)
NixOS module to declare containers (image, IP, devices, ACLs) and have them rebuild/restart on _switch-host. Long-term goal.
Design notes (night-shift planning pass, 2026-06-30)
Not implemented this shift: building a declarative incus orchestration layer would mutate the live fleet (create/configure/restart containers) — unverifiable in CI and risky to run unattended, and it hinges on design decisions that are architect calls. Captured the design surface so it’s actionable later. Set to draft (needs design refinement before implementation), per the repo’s planning≠implementation rule.
Current state (what this would supersede / build on)
- Imperative launch/restart scripts:
packs/home/host/linux/scripts/incus/incus-launch-*.bash,incus-restart-*.bash,incus-setup-storage-ext4.bash— per-container shell, run by hand. - Host incus enablement:
packs/home/host/linux/incus.nix,packs/nixos/host/incus.nix,mixins/home/settings/incus/. - Static fleet list already exists in
mixins/nixos/services/incus-ingress.nixasingressContainers = [ { name; ip; } ... ](onecli .2, searxng .3, yolo .100, spacebot .101, hermes .102). A declarative fleet module should become the single source of truth feeding both container creation and this ingress list (DRY). - Containers are all NixOS containers (
nixos/containers/*); the Ubuntu container setup was dropped.
Key design decisions (need a call before implementation)
- Option schema: e.g.
services.incus.fleet.<name> = { image; ipv4; devices; profiles; acls; storageVolumes; autostart; ... }. - Reconciliation model: activation script / systemd oneshot on
_switch-hostthat diffs declared vsincus list --format jsonand creates/configures/restarts. Must be idempotent and non-destructive (never delete/recreate a container with data; the egress-proxy work showed CA/postgres data lives on custom storage volumes that must persist across recreate). - Image source: build NixOS container images from this flake (reproducible) vs. pull Ubuntu images vs. both. Affects how “image” is declared.
- Scope of management: devices (proxy/disk/gpu),
ipv4.addressoverrides (currently set by hand viaincus config device override), network ACLs, profiles, storage volumes. - Restart policy: what changes trigger a restart vs. a live
incus configapply; avoid disrupting running services unnecessarily. - Migration: supersede the imperative
incus-launch-*/incus-restart-*scripts, or coexist during transition.
Proposed phased decomposition (create as child beans once decisions above are made)
fleetoption schema only (pure types, no side effects) + deriveingressContainersfrom it.- Read-only reconciler: report drift between declared fleet and
incus list(no mutation) — safe to land + verify first. - Create/ensure containers from declarations (idempotent, non-destructive; storage volumes persist).
- Device / ACL / profile / IP-override management.
- Wire restart-on-change into
_switch-host; migrate the imperative scripts.
Start display manager on monitor hotplug (flakes-ilml)
On headless edger cosmic-greeter exits with no connected outputs, greetd hits start-limit-hit, and nothing retries when a monitor is later plugged in. Add a udev DRM hotplug rule that (re)starts display-manager.service only when it is not already active.
- Add packs/nixos/gui/display-manager-hotplug.nix
- Switch edger and verify the rule/service
- Commit and push
Summary of Changes
Added packs/nixos/gui/display-manager-hotplug.nix: udev rules on DRM change events with HOTPLUG=1 (real connector hotplug) or SYNTH_ARG_HOTPLUG=1 (manual synthetic test) start a oneshot that resets and starts display-manager.service only when it is not active.
Verified on edger with a synthetic uevent (echo "change <uuid> HOTPLUG=1" > /sys/class/drm/card1/uevent): greetd went from failed to started, then hit its start limit again with no monitor attached. The greeter itself emits synthetic change events without the hotplug arg, so there is no feedback loop. Note udevadm trigger -p HOTPLUG=1 is rejected by the kernel (-EINVAL), and writes from the Claude sandbox shell did not reach the kernel; use systemd-run or a real shell.
A real monitor plug-in was not tested (edger has none attached).
Zellij WASM plugin for dynamic tab naming (flakes-je55)
Background
We implemented project-aware tab naming in Zellij via fish shell hooks. After extensive iteration, the current approach uses zellij action dump-layout to parse pane names in visual order and compose tab names (e.g., flakes | litmus).
What works well (current fish implementation)
- Project detection via git root basename (
zellij_project_name) - Pane naming with
<project>prefix (zellij_update_panename) - Deterministic pane background colors per project (
zellij_update_pane_color) - Tab name composed from unique project names in visual order (
zellij_visual_projects) dump-layoutparsing gives correct visual order and avoids state file race conditions
Remaining trigger limitations (fish shell can’t solve)
- Pane moves between tabs: no fish event fires when a pane is moved — tab name only updates on next
cd - Pane detach/reattach: splitting a pane into a new tab doesn’t trigger any shell hook
- Non-shell panes: panes running editors, Claude, or other long-running processes never return to fish prompt
- All-tab updates: when a pane moves, both source and destination tabs need updating — fish can only rename the current tab
Why a WASM plugin is the right approach
- Zellij plugins receive native events:
TabUpdate,PaneUpdate,ModeUpdate - A plugin can react to pane moves, tab changes, and layout changes in real-time
- It can update ALL tab names (not just the focused tab) via
rename_tab - No shell hooks needed for tab naming — the plugin handles it entirely
- Fish hooks can focus solely on pane-level concerns (pane name, pane color)
Design considerations
- Research Zellij plugin API for tab/pane events
- Determine how to detect pane project (read pane name set by fish, or query cwd?)
- Prototype plugin that listens to layout changes and renames tabs
- Decide whether to keep fish-based pane naming or move everything to the plugin
- Package the plugin with Nix
Reference
- Zellij plugin docs: https://zellij.dev/documentation/plugins
- Current fish implementation:
modules/home/programs/fish/init/zellij.fish - Tab bar plugin already in use:
~/.config/zellij/plugins/tab-bar.wasm
Replace k3s clash with declarative host mihomo service (flakes-k0sx)
Replace the clash-in-k3s deployment with a declarative services.mihomo host
service, and make the proxy environment for nix-daemon / k3s / containerd
static Nix config instead of imperative systemd drop-ins.
Prerequisite
[[flakes-dw38]] restructures the lan mixins into per-site lan/{102,401,708}
and creates mixins/nixos/cn/, which is where this bean’s proxy-env.nix goes.
Until that lands there is no mixin that covers every CN host.
g1 is confirmed to be a clash host (site 708), so the autowired pack is the
right shape — every host wants the service.
Problems being fixed
- Circular dependency. clash runs as a k3s Deployment, so
k3sandcontainerdneed the proxy in order to pull the image that provides the proxy. Every sync script works around this by hand. - Undeclared state. The
clashDeployment, its NodePort Service and theclash-configConfigMap, plus theyacdDeployment/Service/Ingress, were applied imperatively (152 days ago) and exist nowhere in this repo. - Six imperative scripts in
packs/home/host/common/scripts/nixos/proxy/(sync-/reset-/show-proxy_{nix-daemon,k3s,containerd}) write/run/systemd/system/<svc>.service.d/override.conffrom whatever is in the current shell, thendaemon-reloadand restart the service. Living in/run, they evaporate on reboot. - The ingress was the only reason for k3s, and its HTTPS half is unusable:
yacdserved over TLS atclash-ui.pc.yjpark.orgcannot reach clash’s controller over plain HTTP (mixed content), so only the port-80 route works.
The insight that unblocks it
services.mihomo has a webui option and metacubexd is packaged in
nixpkgs (1.244.2). mihomo serves the dashboard itself from the
external-controller port (-ext-ui), i.e. same origin as the API. That removes
the mixed-content problem and the need for any ingress — which was the only
thing keeping clash in k3s.
yacd is not in nixpkgs, so the dashboard changes to metacubexd.
Verified facts
- Live clash is
docker.io/metacubex/mihomo:latestwith config from theclash-configConfigMap — so the engine is already mihomo; this is a packaging change, not an engine change. - That config is only 46 lines and uses
proxy-providers, so the sole secret is the subscription URL. Current keys:socks-port: 1101,port: 1102,allow-lan: true,external-controller: 0.0.0.0:1109,proxy-providers,proxy-groups,rules. sops-nixin this flake supportssops.templates.<name>.content,sops.placeholder.<secret>andrestartUnits— so a Nix-authored config with the subscription URL injected at activation is possible without a wrapper script.- The
services.mihomounit runs-d /var/lib/private/mihomounderDynamicUser+StateDirectory, so relativeproxy-providerspaths persist across restarts in the state dir. curl8.18 does honour CIDR notation inNO_PROXY(tested against a dead proxy, with a non-matching control that correctly failed), so CIDRs are safe to use in thenix-daemonno_proxylist.- Reachability of the NodePort today depends on
mixins/nixos/ext4/k3s.ext4.nixopening the entire 30000-32767 range to the firewalldpubliczone. Once nothing needs a NodePort from outside, that can be narrowed (separate concern).
Decisions taken
- Ports 21100 / 21101 / 21102 / 21109 (mixed / socks5 / http / controller).
clash-vergestays exactly as it is on 1100-1109 — no collision, no change toset-proxy-verge, and the new service can run alongside it. - Nix-generated config + SOPS subscription URL via
sops.templates, rather than lifting the whole ConfigMap into one opaque encrypted blob. The config is small enough that rules and proxy-groups become reviewable. - No API secret on the controller. 21109 is only reachable over LAN and ZeroTier, which is a personal VPN, so the current no-auth behaviour is kept.
- A pack, not a mixin. Most hosts run clash, so it goes in
packs/nixos/host/clash/and is autowired into all five hosts. All of them already import sops-nix, and every host age key is in both.sops.yamlcreation rules, so one shared subscription secret decrypts everywhere with no per-host work. Precedent:packs/nixos/host/clash-verge.nixis already a pack. - Proxy env lives in
mixins/nixos/cn/, not in the pack and not underlan/— it belongs to “this host is behind the CN firewall”, which is orthogonal to both “runs clash” and “is on a LAN”.g1is on no LAN, so anything underlan/*could never reach it. The newcn/mixin comes from [[flakes-dw38]]. - k3s stays for now. After this lands it hosts only minio — tracked separately.
Spec
1. New: packs/nixos/host/clash/default.nix
Autowired into every host. services.mihomo is a singleton option, but the only
other user is mixins/nixos/services/egress-proxy.nix, which applies inside the
onecli container — a different NixOS configuration, so there is no collision.
services.mihomo = {
enable = true;
configFile = config.sops.templates."clash.yaml".path;
webui = pkgs.metacubexd; # served at http://<host>:21109/ui/
};
sops.secrets."clash-sub-url" = { sopsFile = ./secrets/clash.txt; format = "binary"; };
sops.templates."clash.yaml" = {
restartUnits = [ "mihomo.service" ];
content = ''
mixed-port: 21100
socks-port: 21101
port: 21102
allow-lan: true
external-controller: 0.0.0.0:21109
proxy-providers:
main:
type: http
url: ${config.sops.placeholder."clash-sub-url"}
path: ./providers/main.yaml
interval: 86400
health-check: { enable: true, interval: 600, url: ... }
proxy-groups: ... # ported from the live ConfigMap
rules: ... # ported from the live ConfigMap
'';
};
- No controller
secret— see decisions above. - firewalld: a
clashservice covering 21100/21101/21102/21109, added to thepubliczone (mirroringpacks/nixos/host/clash-verge.nix) and to theincuszone so containers can reach it.
2. New: mixins/nixos/cn/proxy-env.nix
Replaces all six sync/reset scripts. Lands in the cn/ mixin created by
[[flakes-dw38]], which every CN host imports including g1 (which is on no
LAN).
let
proxy = "http://127.0.0.1:21102";
noProxy = lib.concatStringsSep "," [
"localhost" "127.0.0.1" "::1"
"mirrors.tuna.tsinghua.edu.cn" "cache.nixos.org"
"10.0.0.0/8" "10.42.0.0/16" "10.43.0.0/16" "10.100.0.0/24"
"172.22.0.0/16" ".yjpark.org" ".incus"
];
in {
systemd.services.nix-daemon.environment = {
http_proxy = proxy; https_proxy = proxy; no_proxy = noProxy;
};
}
- Same for
k3sandcontainerd, guarded bylib.mkIf config.services.k3s.enable. - Add
after = [ "mihomo.service" ]tok3s/containerd— now safe, since mihomo is a plain unit with nothing to pull. nix-daemonneeds no ordering: it reads the env at start but only uses it lazily at fetch time.- Keep
10.0.0.0/8etc. inno_proxy— confirmed curl honours CIDRs.
3. Modify mixins/nixos/services/egress-proxy.nix
proxyPort = 31102 → 21102, and update the comment: it is no longer a k3s
NodePort but a host service port.
4. Modify packs/nixos/host/incus.nix
The incus-zone firewall port 31102 → 21102.
5. Modify packs/home/common/programs/fish/aliases.nix
Low priority — these are legacy and barely used. Since every host will run clash on the same port, most of them collapse:
set-proxy-trojan31102 → 21102 (consider renaming toset-proxy-clash)set-proxy-edger→ 21102;set-proxy-edger_lanis doubly stale (it points at10.0.1.2, and edger is now10.0.4.2) so deleting it beats fixing itset-proxy-verge(1102) untouched, since clash-verge is unchanged- Worth considering deleting the per-host variants outright rather than renumbering them.
6. Delete packs/home/host/common/scripts/nixos/proxy/
All nine bash scripts. The directory’s default.nix autowires everything in it
into ~/.local/bin/nixos/, so removing the whole directory is the clean
removal.
7. Decommission the k3s objects
Imperative, after the host service is proven:
kubectl -n services delete deploy/clash svc/clash cm/clash-config deploy/yacd svc/yacd ingress/yacd
Migration order
Getting this wrong means losing internet access on a CN-side host, so sequence matters:
- Extract the subscription URL (and pick an API secret) out of the live
clash-configConfigMap and intosecrets/clash.txt. - Land the host mihomo pack and switch pc first. Verify
curl -x http://127.0.0.1:21102 https://example.comand that the dashboard loads athttp://pc:21109/ui/— with the k3s clash still running, so there is a fallback. Only then switch edger. - Land the declarative proxy env; confirm
nix-daemonstill substitutes fast (i.e.no_proxyis actually bypassing the TUNA mirror). - Flip
egress-proxy.nix,incus.nixand the fish aliases to 21102. - Only then delete the k3s clash/yacd objects and the sync scripts.
Both pc and edger are k3s clash hosts
Confirmed: edger runs clash in k3s as well, so both hosts get the same migration
and the same decommission step. The service is an autowired pack, so a single
nixos-rebuild on each host picks it up and the k3s teardown is identical.
Per-host unknowns to check while implementing:
- whether edger’s clash Deployment/Service uses the same ports and the same
clash-configConfigMap shape as pc’s - whether edger also runs a
yacdDeployment + Ingress to drop - whether edger’s k3s hosts anything else (pc’s only other workload is minio, tracked in [[flakes-jspq]])
Corrections to the original spec
Two things in this bean’s spec were wrong, found by reading the live ConfigMap:
- There are two subscription providers,
shadowsocksandokcloud, not one. Each has its own URL, so there are two secrets. Theirhealth-checkURLs are bothhttp://www.gstatic.com/generate_204— not secret, so they stay in the Nix source. - The rules do use
GEOIP,CN. The spec said to keep the config free of GEOIP/GEOSITE rules, because matching them makes mihomo download geodata which it cannot do before the proxy works. The constraint was real but the conclusion was not: the rule has to stay, so the geodata ships from the store instead.
Geodata, and the bootstrap problem it was hiding
The k3s pod’s working directory held geoip.dat (19M), geoip.metadb (9M) and
geosite.dat (4M), all downloaded — into an ephemeral filesystem with no
PVC, so a pod restart re-fetched ~32M through the very proxy it was starting up
to provide.
GEOIP,CN is the only geo rule, so v2ray-geoip’s
geoip-only-cn-private.dat subset suffices at 260K, against 23M for the
full geoip.dat or 8.1M for a dbip mmdb. Installed from the store by an
ExecStartPre, with geo-auto-update: false, so nothing is fetched at runtime
and the data tracks nixpkgs.
Verified against mihomo 1.19.23: Load GeoIP rule: cn →
Finished initial GeoIP rule cn => DIRECT, records: 16482, no download
attempted. Routing then checked both ways through mihomo’s HTTP proxy —
www.baidu.com (CN) returned 200 via DIRECT, example.com matched MATCH and
went to the upstream proxy.
Summary of Changes
packs/nixos/host/clash/default.nix (new)
Autowired into every host.
services.mihomoon 21100 (mixed) / 21101 (socks) / 21102 (http) / 21109 (controller), leaving clash-verge’s 1100-1109 untouched.webui = pkgs.metacubexd— dashboard served from the controller port, same origin as the API, so no ingress and no mixed-content problem. metacubexd shipsindex.htmlat its package root so the path works as-is. (yacdis not in nixpkgs.)- Config rendered via
sops.templates."clash.yaml"with the provider URLs fromsops.placeholder, andrestartUnits = [ "mihomo.service" ]. Providers, proxy-groups and rules are generated from oneprovidersattrset and one rules list. - Rules carried over verbatim, including the absence of
no-resolveon the IP-CIDR rules, so matching behaviour is unchanged. - Exposes read-only
clash.httpPort/clash.proxyUrlso host-side consumers do not repeat the port number. - firewalld: a
clashservice (all four ports) in thepubliczone, plus only 21102 in theincuszone, so containers get the proxy and nothing else.
packs/nixos/host/clash/secrets/clash.yaml (new, SOPS)
The two provider URLs, extracted from the live ConfigMap, encrypted to all six host age keys. Decrypt round-trip checked.
mixins/nixos/cn/proxy-env.nix (new)
http_proxy/https_proxy/all_proxy/no_proxy on nix-daemon, and on k3s
and containerd behind lib.mkIf on their enable flags, the latter two ordered
after mihomo.service. Lowercase names only: curl reads those, Nix propagates
exactly those into fixed-output derivation builders via impureEnvVars, and Go
falls back to lowercase. NIX_CURL_FLAGS dropped — modern Nix ignores it.
no_proxy keeps both substituters direct. Note containerd is not a separate
unit on pc (virtualisation.containerd.enable = false; k3s embeds its own), so
that branch is inert there — the old sync-proxy_containerd script was
targeting something that no longer exists.
Other
mixins/nixos/services/egress-proxy.nix:proxyPort31102 → 21102, with a note on why it stays hardcoded rather than readingconfig.clash.httpPort(the container’s configuration does not import the host pack).packs/nixos/host/incus.nix: the 31102 hole is reverted — the clash pack owns that rule now, so the port number lives in one place.aliases.nix:set-proxy-trojan→set-proxy-clashon 21102, andset-proxy-edgerusesedger.yjpark.zerotierinstead of a raw IP.- Deleted
packs/home/host/common/scripts/nixos/proxy/(nine scripts).
Verification
- All five host configs plus the
oneclicontainer dry-run build. - The rendered config passes
mihomo -twith placeholders substituted, including the GeoIP load. - The
ExecStartPrewas checked against the real sandbox viasystemd-runwithDynamicUser=yes,StateDirectory=,ProtectSystem=strictandPrivateUsers=yes— the file lands in the state directory. onecli’s generated config points at10.100.0.1:21102.- firewalld:
clashinpublic;incuszone ports are 21102 plus the pre-existing 5354 pair.
Not verified, because it needs a switch: that mihomo actually starts, fetches the subscriptions, and serves the dashboard.
Migration hazard: stale /run overrides
/run/systemd/system/nix-daemon.service.d/override.conf exists on pc right
now, written by the old sync-proxy_nix-daemon, pointing at localhost:31102.
/run drop-ins outrank /etc ones, so it will shadow the new declarative
environment until removed or the host reboots — and it names a port that stops
existing once the k3s clash is deleted.
Clear it during the switch, before deleting the k3s objects:
sudo rm -rf /run/systemd/system/{nix-daemon,k3s,containerd}.service.d
sudo systemctl daemon-reload
sudo systemctl restart nix-daemon
Then check systemctl cat nix-daemon | grep proxy shows only 21102.
reset-proxy_nix-daemon used to do this and is being deleted, so the step must
happen before or during the switch.
Switched pc — verification results
Switched on 2026-10-06 and verified in place.
Working:
| check | result |
|---|---|
| mihomo.service | active, all four ports listening (21100/21101/21102/21109) |
| geodata | geoip.dat 262965 bytes installed from the store by ExecStartPre |
| subscriptions | both shadowsocks.yaml and okcloud.yaml fetched and persisted in the state directory |
| sops | pc host key imported, both secrets and the rendered clash.yaml applied |
| proxy | example.com 200, github.com 200, api.anthropic.com 403 (auth, so reachable) |
| GEOIP,CN | www.baidu.com 200 via DIRECT |
| dashboard | http://127.0.0.1:21109/ui/ returns 200 |
| firewall | lan sources narrowed to 10.0.1.0/24; clash in public; incus ports 5354/tcp 21102/tcp 5354/udp |
| nix-daemon | declarative env active after clearing the stale /run drop-in |
| substituters stay direct | cache.nixos.org download succeeded with no corresponding entry in mihomo’s log |
| FOD proxy propagation | proven: a fixed-output derivation whose hash only matches the string http://127.0.0.1:21102 built successfully, so the daemon’s env does reach FOD builders |
| k3s fallback | the k3s clash pod survived the k3s restart (same pod, no new restart count), so the old proxy remained available throughout |
The stale /run/systemd/system/nix-daemon.service.d/override.conf was removed
as planned; nix-daemon now shows only the 21102 environment.
Two issues found while verifying
1. firewalld reload was broken — fixed
The switch reported Failed to reload firewalld.service, and the new firewall
config did not apply: the lan zone still showed 10.0.0.0/16 and clash was
absent from the public zone.
Cause: the unit ends up with two ExecReload= lines — firewalld’s own
packaged /bin/kill -HUP $MAINPID, which does not exist on NixOS, plus the
correct coreutils path the nixpkgs module adds as a drop-in. systemd appends
Exec* directives rather than replacing them, so the broken one runs first and
fails the whole reload with 203/EXEC.
This is an upstream nixpkgs bug: the module sets
serviceConfig.ExecReload to a bare string instead of a list beginning with
"". It means no firewalld config change in this repo has ever applied on
switch without a manual systemctl restart firewalld — including the
reloadTriggers wiring already present in
packs/nixos/common/settings/firewalld.nix, which was added for exactly this
symptom and never worked.
Fixed locally in that file with ExecReload = lib.mkForce [ "" "<coreutils>/bin/kill -HUP $MAINPID" ].
Verified: systemctl reload firewalld now logs Reloaded firewalld and exits 0.
2. Provider fetch races the proxy group at startup
mihomo’s first shadowsocks fetch failed with a TLS handshake timeout because
MATCH,Shadowsocks routed the subscription request through a group whose
provider was not loaded yet (logged as Shadowsocks[COMPATIBLE]). It recovered
on retry, but startup is non-deterministic as a result.
Both subscription hosts are reachable directly from CN — checked before
switching, 404 and 403 on the bare paths, i.e. TLS completes. So explicit
DIRECT rules for the two subscription domains ahead of MATCH would make
startup deterministic. Worth doing, tracked as a follow-up task below.
Incidental
cache.numtide.com — newly enabled for llm-agents — does go through the proxy,
since it is not in no_proxy. Probably what is wanted for a non-CN cache, but
noting it in case it should be direct.
Decision: no DIRECT rules for the subscription domains (task dropped)
The earlier suggestion to add DOMAIN-SUFFIX,<subscription host>,DIRECT ahead
of MATCH was wrong, and the objection to it is correct: subscription refreshes
sometimes need the proxy, and a DIRECT rule would permanently remove that.
The current rules already do the right thing in both directions:
- Cold start, no cached provider list. The group holds no proxies yet, so
mihomo falls back to its
Compatibleadapter — what the log showed asShadowsocks[COMPATIBLE]— which dials direct. That is the only thing it could do; there is no proxy available to use. - Every later refresh. Providers are loaded, so the fetch matches
MATCH,Shadowsocksand goes through the proxy. This is exactly the case worth protecting, and a DIRECT rule would break it.
The “startup race” also turned out not to matter. Verified by restarting
mihomo: the proxy served traffic 0.24s after restart, with no provider
fetch and no error, because shadowsocks.yaml and okcloud.yaml now persist
in the state directory. The blocking first fetch only happens on a genuinely
empty state directory — first start after deploy — and even then it retried and
succeeded.
That persistence is itself an improvement over the pod, which had no PVC and so took the cold path on every single restart.
So the only remaining failure mode is “first ever start and the subscription host is blocked directly”, where a DIRECT rule would make things worse rather than better. No change.
Dashboard access
Served by mihomo itself from the controller port, same origin as the API, so it needs no ingress and has no mixed-content problem:
http://pc:21109/ui/from site 102http://pc.yjpark.zerotier:21109/ui/from any site
Verified 200 from loopback, the LAN address and the ZeroTier address. The
clash firewalld service is in the public zone, which covers both eno1 and
ZeroTier. No token is needed — the controller has no secret, as decided.
Node selection needs attention in the UI
The controller reports Shadowsocks with 27 options and OKCloud with 35, but
both selectors default to their provider’s first entry, which in both cases
is an information label rather than a server:
Shadowsocks→有效期2026-11-13, 剩余 81.15 GB— this one does route; traffic through 21102 works.OKCloud→官网:okyun01.com 如果没有节点请更新软件— almost certainly not a routable server. Harmless today becauseMATCHpoints atShadowsocks, but selectingOKCloudwould fail until a real node is picked.
Selections persist in cache.db in the state directory, so choosing nodes in
the dashboard survives restarts.
Tasks
- Inspect edger’s k3s — moot: k3s removed entirely (flakes-itu2); edger ran only cert-manager + clash + yacd
- Extract the subscription URLs (two providers) into
packs/nixos/host/clash/secrets/clash.yaml(SOPS) - Port
proxy-groupsandrulesfrom the ConfigMap into the Nix-authored config - Create
packs/nixos/host/clash/default.nix(services.mihomo + sops.templates + firewalld, ports 21100/21101/21102/21109, metacubexd webui, no controller secret) - Ship GeoIP data from the store instead of letting mihomo download it
- Switch pc, then verify the proxy and the dashboard work while the k3s clash is still running
- Clear the stale
/run/systemd/system/*.service.ddrop-ins (see Migration hazard) - Create
mixins/nixos/cn/proxy-env.nixfor nix-daemon / k3s / containerd, withafter = mihomo.serviceon the latter two - Verify
no_proxykeeps substituter traffic direct - Fix the firewalld ExecReload bug that stopped firewall changes applying on switch
- Decide on DIRECT rules for the subscription domains — dropped, see Decision below
- Flip
egress-proxy.nixproxyPort to 21102; theincus.nixhole is reverted and now owned by the clash pack - Update the
set-proxy-*fish aliases - Delete
packs/home/host/common/scripts/nixos/proxy/ - Delete the k3s
clashandyacdobjects — done by removing k3s from all hosts (flakes-itu2) - Roll out to the remaining hosts (a13, g1, p2) and confirm each one’s proxy works
- Re-verify the onecli → clash egress chain after the port flip (see [[flakes-i9ao]])
Coupling with flakes-i9ao
flakes-i9ao just landed the onecli egress chain pointing at 10.100.0.1:31102
and still has unverified in-situ checks. Either verify it on edger first and
then renumber, or do both in one deploy — but do not renumber while the original
chain is still unproven.
Notes (2026-10-07)
- a13 and p2: host mihomo active, nix-daemon proxied via 127.0.0.1:21102 (checked during flakes-itu2). g1 still unverified (offline).
MCP OAuth: browser-open + callback forwarding (desktop + WSL) (flakes-mqe9)
Completes the MCP OAuth bridge: the container-side callback relay is done (flakes-wq6s). This bean covers opening the authorize URL where the human actually is and routing the callback back, for the two real access patterns (there is no Mac/lima in this setup — superseding the original external-Mac framing).
Access patterns
- Case 1 — host Linux desktop →
incus exec→ container. Browser = hostxdg-open. Callbacklocalhost:3118= the host. - Case 2 — Windows → WSL (Ubuntu, home-manager-managed by this repo) →
ssh host→incus exec→ container. Browser = Windows default browser, opened from WSL viawslview/cmd.exe /c start. Callbacklocalhost:3118= Windows → WSL localhost forwarding.
Unification
The container always reaches the host at its bridge gateway (10.100.0.1), self-discoverable inside the container via ip -4 route show default (must be derived in the container, not the attach wrapper — on the host default is the uplink). No hardcoded IPs; optional me.hostBridgeIp override for odd setups. Host-side listeners bind the incus bridge address (incus network get incusbr0 ipv4.address).
| Case 1 (host desktop) | Case 2 (Windows→WSL→SSH) | |
|---|---|---|
| Detect (attach) | no SSH_CONNECTION, WAYLAND_DISPLAY set | SSH_CONNECTION set |
| Open URL | container→gateway:OPEN→host xdg-open listener | container→gateway:OPEN→host ssh -R→WSL listener→wslview |
| Callback | host 127.0.0.1:3118 → container:3118 (socat/systemd-proxy) | WSL ssh -L 3118:<container>:3118 |
Phasing
- Phase A (universal, no detection): container
$BROWSER(+xdg-openshim) writes the URL to the human’s TTY as OSC 8 hyperlink + OSC 52 clipboard + plain text + bell. Lands on whichever terminal the human is at (host desktop or Windows Terminal via WSL/SSH), survives zellij detach/reattach, one click. → child bean (implemented first). - Phase B (zero-click): Case 1 host
systemd --userxdg-openlistener on the bridge IP; Case 2 WSLwslviewlistener +ssh -Rback-tunnel + host sshdGatewayPorts clientspecified. Attach-time detection injectsBROWSER_ROUTE; OSC stays the fallback for moved/stale sessions.
Callback forwards (needed even in Phase A)
- Case 1: host socat/systemd-socket-proxyd
127.0.0.1:3118 → 10.100.0.100:3118. - Case 2: WSL
programs.ssh.matchBlocks.<host>LocalForward 3118 10.100.0.100:3118(Windows localhost:3118 → WSL → host → container Caddy bridge → CC).
Children
- Phase A — container browser-open script (OSC).
- Host-desktop side — callback socat + Phase B xdg-open listener.
- WSL side — callback LocalForward + Phase B wslview auto-open + host sshd GatewayPorts.
Niri config: declarative host-based mixin (flakes-p2qs)
Make niri KDL config fully declarative by moving host-specific extras into per-host mixins, eliminating the manual apply-extras step.
Summary of Changes
- Added
me.niri.extraConfigoption tomodules/home/options.nix - Updated
modules/flake/home-configs.nixto support directory-based host mixins (falls back to/{host}.nixif no directory exists) - Created
mixins/home/hosts/a13/andmixins/home/hosts/edger/withdefault.nix+niri.extras.kdl - Rewrote niri config module to concatenate
config.common.kdl+config.me.niri.extraConfig - Deleted
extras.a13.kdl,extras.edger.kdl, andniri.justfilefrom old location
Add mdBook documentation site (flakes-px5o)
Create a docs/ folder using mdBook to maintain documentation about the flakes configuration. Seed initial content from CLAUDE.md, integrate with Nix flake (packages.docs, apps.docs-serve), and add mise tasks (docs-build, docs-serve).
Summary of Changes
- Created with mdBook structure (book.toml + 6 content pages seeded from CLAUDE.md)
- Added with (nix build) and
- Added and mise tasks
- Added to
Fish functions for jj workspace management (flakes-rhqy)
Convention-based jj workspace management via fish shell functions. All workspaces at ~/workspaces/
Functions
| Abbr | Full name | Behavior |
|---|---|---|
| wl | workspace-list | List all workspaces across all projects with bookmark + dirty/conflict status |
| w | workspace-cd | cd to a workspace + show brief status. Tab-completes |
| wc | workspace-create | From inside a repo, create ~/workspaces/ |
| workspace-delete | (no abbr) | Forget + remove a workspace |
Design Details
Convention
- All workspaces at ~/workspaces/
/ = basename of the main repo root - Default workspace = the main repo itself
Registry (~/.config/workspaces.conf)
- Maps project name to main repo path (e.g. llm-triage=/home/yj/code/llm-triage)
- Auto-populated by wc on first use
- Needed to discover default workspace / run jj commands from the right root
workspace-list (wl)
- Iterates all registered projects
- For each: runs jj workspace list from main repo, then for each workspace shows:
- Workspace name (default or feature name)
- Path (main repo or ~/workspaces/
/ ) - Bookmark name (or ‘no bookmark’)
- Change-id (short)
- Status: clean / dirty / conflicts
- Grouped by project
workspace-cd (w)
- w
/ → cd to workspace path + print one-line status (bookmark, change-id, dirty/conflicts) - w
/default → cd to main repo root - Tab completion for all
/ combos - w with no args → do nothing
workspace-create (wc)
- Must be run from inside a jj repo
- wc
→ jj workspace add ~/workspaces/ / - Auto-registers project in ~/.config/workspaces.conf if not present
- cd to the new workspace after creation
workspace-delete
- workspace-delete
/ → jj workspace forget (from main repo) + rm -rf the directory - No abbreviation (destructive operation)
- Tab completion same as w
Tasks
- Create workspace-list.fish function
- Create workspace-cd.fish function with completions
- Create workspace-create.fish function
- Create workspace-delete.fish function
- Add abbrs (wl, w, wc) to abbrs.nix
- Wire functions into fish module via nix (autowired automatically)
Monitoring: per-service/per-process usage + vmui Hosts dashboard (flakes-szt9)
Per-service and per-process resource usage (top/atop-style, over time), plus a host overview dashboard in vmui.
Spec
Exporters (agent.nix, every agent host)
services.prometheus.exporters.systemd: per-unit CPU / memory / IO / restarts. Bind 127.0.0.1, add scrape job (instance relabelled to hostname like the others).services.prometheus.exporters.process: group by command name ({{.Comm}}), never per-PID — bounded cardinality. Bind 127.0.0.1, add scrape job.- Add ports to
monitoring.ports(defaults from the exporters: systemd 9558, process 9256). - Check series counts per host after rollout; trim collectors if one dominates.
vmui “Hosts” dashboard (hub.nix)
- VictoriaMetrics
-vmui.customDashboardsPath=<store path>(flag present in 1.139; format: VictoriaMetrics repoapp/vmui/packages/vmui/public/dashboards). - Generate the JSON from Nix (
builtins.toJSON) so it lives with the module. - Panels: up per host, CPU %, memory %, disk % per mount, network rx/tx, load5, failed units, top-10 services by CPU/mem (systemd exporter), top-10 process groups by CPU/mem (process exporter).
Out of scope
programs.atopper-PID history (forensic replay viaatop -r) — only if the 30s-resolution view proves insufficient.
Todo
-
systemd exporter + scrape jobdropped: systemd_exporter 0.7 no longer exports per-unit CPU/memory (only state/restarts/sockets, already covered by node_exporter systemd collector). Per-service usage comes from process-exporter grouped by cgroup instead. - process exporter + scrape job — groupname
{{.Comm}}|{{.Cgroups}}, vmagent splits intocomm,cgroup,unitlabels; covers systemd units, incus containers (lxc.payload.*) and k3s pods. -threads=false, -gather-smaps=false; runs unprivileged so no per-process io. - Verify on pc and edger; note series counts — process job: edger ~2.6k, pc ~2.2k series
- vmui custom dashboards (dashboards.nix): “Hosts overview” + one “Host:
” per monitoring.hosts(vmui has no template variables) - Verify dashboard renders on both hubs (custom-dashboards endpoint serves all 3 on pc and edger; every panel query returns data)
Notes
- 2026-10-07 pc: ~2.4k process series; every dashboard panel query returns data on the pc hub.
- New option
monitoring.hosts(default: hub names) lists agent hosts for per-host dashboards.
Summary of Changes
- process-exporter grouped by
{{.Comm}}|{{.Cgroups}}, split by vmagent into comm/cgroup/unit labels → top processes and per-service/container/pod usage. - systemd_exporter dropped (no per-unit CPU/mem in 0.7).
dashboards.nix: vmui Hosts overview + per-host dashboards frommonitoring.hosts.- Surfaced: greetd.service failed on both pc and edger.
Zellij per-project auto-layouts on cd (flakes-u0yw)
Spec
When cd’ing to a project directory inside Zellij, automatically open a new tab with a layout matching the project’s configuration.
Preset Layout Files
Location: modules/home/programs/zellij/layouts/ → deployed to ~/.config/zellij/layouts/
claude_terminal.kdl — claude on left (50%), terminal on right (50%)
claude_beans-terminal.kdl — claude on left (50%), right side split: beans-serve --cors-origin "*" on top, stacked terminals below
Presets have no cwd — the fish hook passes --cwd at open time, keeping presets project-agnostic.
Layout Resolution Order
.zellij-layout.kdlfile in project root (inline layout, highest priority)ZELLIJ_LAYOUT_{USERNAME}env var (e.g.,ZELLIJ_LAYOUT_yj=claude_beans-terminal) — only if$USERmatchesZELLIJ_LAYOUTenv var — generic fallback- Neither → do nothing
Env vars are set via .envrc (direnv), e.g.:
export ZELLIJ_LAYOUT=claude_terminal
export ZELLIJ_LAYOUT_yj=claude_beans-terminal
export ZELLIJ_LAYOUT_yjpark=claude_terminal
Fish Hook Logic
Extend existing PWD hook in modules/home/programs/fish/init/zellij.fish:
- Not in Zellij? → skip
- Resolve project root (existing git root detection)
- Determine layout (resolution order above)
- Guard: check
__zellij_opened_layoutsfish global var — if project root already in list → skip zellij action new-tab --layout {layout_file} --cwd {project_root}- Add project root to
__zellij_opened_layouts
State resets when fish session ends. Re-opening after terminal restart is acceptable.
Relationship to existing bean
Related to flakes-kxju (predefined layout files) — this is the broader feature that subsumes it.
Tasks
- Create
claude_terminal.kdlpreset layout - Create
claude_beans-terminal.kdlpreset layout - Extend
zellij.fishPWD hook with layout resolution and auto-open logic - Test: cd to project with
ZELLIJ_LAYOUTset →zzapplies layout to current tab - Test: stacked layout, tab/status bars, clear buffer all working
- Test:
ZELLIJ_LAYOUT_yjoverridesZELLIJ_LAYOUTfor useryj - Test:
.zellij-layout.kdlin project root takes priority (not yet tested)
Setup SearXNG search for agents (flakes-woco)
Deploy SearXNG as a self-hosted meta-search engine to provide web search capabilities for agents (spacebot, hermes, etc.).
- https://github.com/searxng/searxng
Goals
- Run SearXNG as a service accessible to agent containers over the LAN
- Provide a search API endpoint agents can call (JSON format) without external API keys
- Keep configuration declarative via Nix
Open Questions
- Run as NixOS system service in a dedicated incus container at 10.100.0.3
- Which search engines to enable by default?
- Authentication/rate-limiting for the API endpoint?
- Integration method: MCP server, direct HTTP API, or tool wrapper?
Summary of Changes
- Created
nixos/containers/searxng/NixOS container config:- Static IP 10.100.0.3, services.searxng with JSON format enabled
- Engines: google, bing, duckduckgo, wikipedia, github
- Listens on 0.0.0.0:8080; no auth needed (LAN-only)
- Uses full container pack (ingress.nix auto-discovers port 8080)
- Registered “searxng” in
flake/nixos-configs.nix - Added searxng to
incus-ingress.nixingressContainers (10.100.0.3) - Added
incus-launch-searxng.bash - JSON API: http://10.100.0.3:8080/search?q=<query>&format=json
- Caddy: searxng-8080.<host>.yjpark.org → http://10.100.0.3:8080
Cross-container MCP OAuth callback bridge (flakes-wq6s)
Claude Code running inside a nested container does MCP OAuth, but the callback listener is loopback-only and the redirect host is hardcoded to http://localhost:<port>/callback. The browser opens on the Mac, so localhost resolves to the Mac, not the container — today this needs a manual URL-copy + in-container curl to finish the flow.
Ground truth (from the CC binary)
- Callback port default is a random ephemeral port.
MCP_OAUTH_CALLBACK_PORTenv wins unconditionally (no availability check) — pinning is mandatory.- Listener binds
127.0.0.1only; redirect host/path is hardcoded (only the port is configurable, not the host).
Fix — pinned-port loopback bridge
Mac browser -> http://localhost:3118/callback
-> [Mac launchd] socat 127.0.0.1:3118 -> <container-ip>:3118
-> [container] Caddy site http://:3118 { bind <container-ip>; reverse_proxy 127.0.0.1:3118 }
-> Claude Code listener @ 127.0.0.1:3118 (done)
- Pin
MCP_OAUTH_CALLBACK_PORT=3118in the container env. - Container-side bridge relays
<container-ip>:3118 -> 127.0.0.1:3118. A socket bound tolowon’t serve a connection arriving oneth0, so a bridge is required. Reuse the already-running reverse proxy (Caddy) instead of a new socat daemon.- Gotcha: a Caddy site-address host controls Host matching, not the listen interface.
http://<ip>:3118listens on0.0.0.0and steals CC’s127.0.0.1:3118(env port has no availability check). Usehttp://:3118 { bind <ip> }so it binds the container IP only, leaving loopback free for CC.
- Gotcha: a Caddy site-address host controls Host matching, not the listen interface.
- Mac forwarder = launchd socat over the existing host→container route.
Phase 2 — auto-open the authorize URL (true zero-touch)
Mac launchd listener that runs open <url>; container sets BROWSER to a script that ships the URL to it (+ an xdg-open shim). Restrict by shared secret, NOT subnet — the bridge NATs container traffic so the Mac sees the VM’s source IP, not the container’s.
Scope in this repo
- In-repo (NixOS container configs under
nixos/containers/): theMCP_OAUTH_CALLBACK_PORT=3118env var and the Caddyhttp://:3118 { bind <ip> }site. Container IPs are already statically assigned (seemixins/nixos/services/incus-ingress.nix). - External (not managed by this flake): the Mac-side launchd socat forwarder and the Phase-2
open <url>listener live on the macOS host (lima VM), outside this repo. - Verification caveat: the end-to-end OAuth flow can only be confirmed against the live container + Mac; a build here proves the config evaluates, not that the bridge works.
Todo
- Pinned
MCP_OAUTH_CALLBACK_PORT=3118(NixOS container env viapacks/nixos/container/mcp-oauth-bridge.nix; also fed to the ingress-sync service) - Caddy bridge site emitted by the ingress generator (
generate-ingress-config.bash, both nixos + home copies): detects container IP viaip route getand writes/var/lib/caddy/mcp-oauth.confwithhttp://:3118 { bind <ip>; reverse_proxy 127.0.0.1:3118 }. Verified withcaddy validate - Mac-side launchd socat forwarder documented as external (see follow-up bean)
- (external follow-up) Phase 2:
BROWSERshim + xdg-open script + shared-secret auth - (external follow-up) Verify end-to-end against a live container + Mac forwarder
Summary of Changes
Implemented the in-repo (container-side) half of the bridge and verified it; the macOS-host half is tracked separately in flakes-mqe9.
Files
packs/nixos/container/mcp-oauth-bridge.nix(new): pinsMCP_OAUTH_CALLBACK_PORT=3118(login-shell env for Claude Code) and passes the same port to theingress-syncsystemd service.packs/nixos/container/ingress-scripts/generate-ingress-config.bashandpacks/home/container/ingress/generate-ingress-config.bash(identical edits): the ingress generator now detects the container IP (ip -4 route get 1) and writes/var/lib/caddy/mcp-oauth.conf=http://:3118 { bind <ip>; reverse_proxy 127.0.0.1:3118 }, before the existing atomiccaddy reload. The IP-detect assignment uses|| trueso a missing default route at early boot can’t abort the whole generator underset -euo pipefail.
Why a dedicated IP-bound site: CC’s callback listener binds 127.0.0.1:3118 only and its env-pinned port has no availability check, so the bridge must bind the container IP (eth0) — not 0.0.0.0 — leaving loopback free for CC.
Verified: nix eval confirms the env var + ingress-sync Environment; the full yolo system toplevel evaluates; caddy validate returns Valid configuration for the generated bridge site (real IP 10.100.0.100) in a Caddyfile mirroring the real structure; bash -n passes; both generator copies remain identical. A review subagent verified module merge, no port collision with the auto-generated 3118.<host>.incus site, env delivery, and found the pipefail bug (fixed).
Not done (external → flakes-mqe9): the Mac launchd socat forwarder (localhost:3118 → <container-ip>:3118), Phase 2 zero-touch auto-open, and live end-to-end verification — these live on the macOS host/lima VM, outside this repo.
Reach pc ingress services without ZeroTier (flakes-xv5g)
hub_pc.yjpark.org works off ZeroTier, but the links on the hub page (<svc>.pc.yjpark.org, <c>-<port>.pc.yjpark.org) resolve to pc’s ZeroTier IP 172.22.1.9 (the *.pc.yjpark.org A record isn’t proxied), so they don’t load from outside.
Constraints
- Universal SSL covers only
*.yjpark.org(one level). Proxying*.pc.yjpark.orgwould need Advanced Certificate Manager or Total TLS, and would take those names away from ZeroTier-direct use. - pc’s tunnel is remote-managed, so ingress rules live in Cloudflare, not in Nix.
- Container ports are found at runtime (hub API), so no fixed list exists for them.
Options
- Flat public names, e.g.
<svc>_pc.yjpark.org/<c>-<port>_pc.yjpark.org, covered by*.yjpark.org. One wildcard tunnel rule (or one per service) to Caddy on :80. Caddy also matches the_pcform and maps it to the same routes. The hub page picks public or ZeroTier URLs based on the hostname it was loaded from. Needs a wildcard DNS record or a record per name, and Access on each name (or one wildcard Access app). - Move the tunnel to locally-managed config (services.cloudflared ingress in Nix), with rules generated from ingress.services. Fully declarative, but static. Container ports would still need a wildcard (option 1).
- Path-based through the hub (
hub_pc.yjpark.org/s/<name>/): no DNS or certificates to set up, but breaks apps that expect to sit at the root path (this was dropped before in flakes-i4ol).
Leaning toward 1. Open question: is *.yjpark.org already used by anything else?
Add git worktree support to workspace commands (flakes-y87y)
Extend workspace-create, workspace-list, workspace-cd, workspace-delete, and completions to support git worktree in addition to jj workspaces. Runtime VCS detection (jj priority over git). Git worktrees create new branches by default.
Summary of Changes
Added git worktree support to all workspace commands:
- workspace-create: detects jj vs git, uses git worktree add -b for git repos
- workspace-list: shows (jj)/(git) indicator per project, git worktrees show branch/hash/status
- workspace-cd: shows git branch/hash/status when navigating to git worktrees
- workspace-delete: uses git worktree remove for git repos
- completions: lists git worktrees alongside jj workspaces
- New helper __workspace_list_git_entry.fish for git worktree display formatting
Tasks
- Disable terminal bell sound (flakes-0u0f) — Done ·
archived - Create mise-run-or-just fish function (flakes-0ycg) — Done ·
archived - Enhance tv-mise-tasks to handle tasks with arguments (flakes-14he) — Done ·
archived - Make j abbreviation expand conditionally to mise run or just (flakes-1cc9) — Done ·
archived - lima->incus host-routable VM IP + self-healing route (macOS) (flakes-1huh) — Draft
- Expose pc ingress hub via Cloudflare tunnel as hub_pc.yjpark.org (flakes-2ab4) — Done
- Convert onecli-reseed to a manually-invoked script (flakes-2ey6) — Done
- Tidy up the shell title when running zellij (flakes-2fpy) — Done ·
archived - Monitoring: shared topology module (hubs, roles, ports) (flakes-2gf7) — Done
- Expose edger ingress hub via Cloudflare tunnel as hub_edger.yjpark.org (flakes-30pz) — Done
- Monitoring: VictoriaMetrics + VictoriaLogs hub on pc and edger (flakes-4c4d) — Done
- Remove stateVersion mixin pattern, use defaults instead (flakes-5pbu) — Done ·
archived - Restructure home config host/container registration (flakes-6n5b) — Done ·
archived - Install latest beans via nix flake (flakes-6ne0) — Done
- Resolve username from host/container dir in activate-home.nix (flakes-7aac) — Done ·
archived - Remove spacebot and hermes containers (flakes-7g5s) — Done
- Setup markdown-oxide (flakes-7ih3) — Done ·
archived - Monitoring: MCP servers for agents (VictoriaMetrics + VictoriaLogs) (flakes-7o0r) — In Progress
- Configure & run ZeroClaw (config, secrets, service) (flakes-8itl) — Draft
- Automate OneCLI CA push to containers on boot (flakes-aurl) — Done ·
archived - Set up Incus across machines (flakes-bxl7) — Done ·
archived - Auto-trigger tab completion after j abbr expands to mise run _ (flakes-c03b) — Done ·
archived - Monitoring: node_exporter + vmagent dual-write on each host (flakes-c6gm) — Done
- Migrate container IPs to new scheme (flakes-cjao) — Done
- Move p2 host to site 102 (flakes-cva3) — Done
- Expose kudo on pc via Cloudflare tunnel as kudo_pc.yjpark.org (flakes-d9tk) — Draft
- Drop nixos-unified, use raw flake-parts (flakes-dght) — Done
- Restructure lan mixins: per-site LANs plus separate cn concerns (flakes-dw38) — In Progress
- Ingress hub on p2, exposed as hub_p2.yjpark.org (flakes-gb22) — Draft
- Unify terminal theme to Tokyo Night (flakes-hncv) — Done ·
archived - Remove k3s from all hosts (flakes-itu2) — Done
- Replace autowire.nix with jig lib (flakes-iymi) — Done ·
archived - wezterm: Claude Code editing ergonomics (shipped) (flakes-jkwu) — Done
- Set up firewalld as NixOS service and migrate existing firewall rules (flakes-jvmx) — Done ·
archived - Setup quartz to preview and publish oxide projects (flakes-k391) — Draft
- Check MCPVault, to see whether it’s a better option for the markdowns (flakes-k3pr) — Done
- Install Zeroclaw (flakes-kj17) — Done
- Fix CA cert injection to be declarative (flakes-krtw) — Done
- Monitoring: journald → vlagent dual-write log shipping (flakes-m1as) — Done
- Monitoring: vmalert health rules (per-site, no double alerts) (flakes-me6e) — Todo
- Update CLAUDE.md to reflect current state (flakes-nyvs) — Done ·
archived - Setup colima with incus (flakes-o04s) — Done ·
archived - Add edit-in-place script (flakes-oh4v) — Done ·
archived - Add GitHub token via OneCLI + container git config (flakes-oi2x) — Done ·
archived - Refactor ai.nix into ai/ directory (flakes-ojyn) — Done ·
archived - Host-desktop: callback forward + xdg-open auto-open (flakes-ok62) — Todo
- MITM egress-proxy CLI: stable CA + ease-of-use (reference) (flakes-p2dp) — Draft
- Configure jjui theme for readability with Pencil Dark terminal theme (flakes-p7hc) — Done ·
archived - Unify incus container image build tasks (flakes-p8hf) — Done
- Add Cloudflare MCP server to Claude settings (flakes-pbel) — Done
- Setup OpenCode and Claude for spacebot container (flakes-pr3i) — Done
- Remove rtk setup (flakes-pzk7) — Done
- WSL: callback forward + wslview auto-open (flakes-q3l5) — In Progress
- Package beans-serve (web UI) from source via nix (flakes-qe0o) — Draft
- Integrate Home Manager as a NixOS module (flakes-rg27) — Done ·
archived - Migrate from just to mise for task running (flakes-rg2j) — Done ·
archived - Trial MCPVault as an MCP server for the notes vault (flakes-rv2o) — Draft
- Full jjui theme with terminal-independent hex colors (flakes-sk2r) — Done ·
archived - Containerize OneCLI (flakes-t9u2) — Done
- Bootstrap home-manager on x1 WSL (Ubuntu) (flakes-tnjz) — Todo
- Inhibit idle/sleep during audio/video playback (flakes-va02) — Done ·
archived - Dynamic per-host Home Manager configs via flake module (flakes-vaiq) — Done ·
archived - Phase A: container browser-open script (OSC) (flakes-vzo1) — Done
- pc: move /home to dedicated ext4 disk (nvme0n1) (flakes-wabt) — Done
- Remove k3s from g1 (offline during flakes-itu2) (flakes-x7wb) — Todo
- Container-to-host network isolation (flakes-x821) — Done
- Add rtk-rewrite.sh hook to claude module with home-manager linking (flakes-y887) — Done ·
archived - Replace CopyQ with cliphist (Wayland-native clipboard manager) (flakes-yyox) — Done ·
archived - Add mdbook-beans tasks section to docs (flakes-zvh8) — Done ·
archived
Disable terminal bell sound (flakes-0u0f)
Disable audible bell in kitty and wezterm to prevent loud alert sounds during terminal work.
Summary of Changes
- kitty: set
enable_audio_bell = no - wezterm: set
audible_bell = 'Disabled'
Create mise-run-or-just fish function (flakes-0ycg)
Create a fish wrapper function that auto-detects whether to use mise run or just based on whether mise is configured in the current directory. Update the j abbr to use it.
Summary of Changes
- Created : wrapper that checks [ { “path”: “/home/yj/agents/flakes/mise.toml”, “tools”: [] } ] output; if non-empty array, uses , otherwise falls back to
- Updated line 21: →
Enhance tv-mise-tasks to handle tasks with arguments (flakes-14he)
Update tv-mise-tasks fish function to detect required args via ‘mise tasks info –json | jq’ and either run directly or pre-fill command line.
Make j abbreviation expand conditionally to mise run or just (flakes-1cc9)
Update fish config to use abbr –function for j so it expands inline to ‘mise run’ or ‘just’ based on current directory
lima->incus host-routable VM IP + self-healing route (macOS) (flakes-1huh)
Reaching incus containers (e.g. 10.100.0.0/24) directly from macOS, surviving reboots and VM IP changes.
Note on scope: the moving parts here are macOS-side — a lima VM template and launchd agents on the Mac host. This flakes repo manages NixOS/home-manager, not the macOS host or the lima template, so this is largely external. Captured as a reference/draft bean; the in-repo touchpoint is boot.autostart and container networking inside incus.
Design
- vzNAT network in the lima template gives the VM a host-routable IP (Mac
192.168.64.1, VM192.168.64.5); the container reaches the Mac via VM NAT. This is the substrate the MCP OAuth bridge rides on. - Self-healing route: a launchd agent runs an idempotent
ensure-route— it only touches the routing table when the route is missing or stale (no-op + no sudo when it already points at the VM’s current IP). A one-timeroute-allow-sudodrops a narrow sudoers line so the agent can maintain the route unattended. - VM auto-start via a launchd agent so containers survive Mac reboots (
boot.autostartinside, agent restores the route once the VM is up).
Todo
- (External) lima template with vzNAT network
- (External) launchd
ensure-routeagent + narrowroute-allow-sudosudoers line - (External) launchd VM auto-start agent
- (In-repo, if applicable) confirm
boot.autostartis set on incus containers that should survive reboots
Expose pc ingress hub via Cloudflare tunnel as hub_pc.yjpark.org (flakes-2ab4)
pc’s cloudflared tunnel (829deb72…) is remote-managed (config source: cloudflare), so the route is added through the Cloudflare API/dashboard, not Nix.
Plan
- Tunnel ingress rule (before the 404 catch-all): hostname hub_pc.yjpark.org → http://localhost:80, originRequest.httpHostHeader = hub.pc.yjpark.org (host Caddy routes by Host; the HTTP block avoids TLS SNI/cert mismatch)
- DNS: CNAME hub_pc → 829deb72-9870-4b61-9120-bf748d85fbd2.cfargotunnel.com, proxied
- Cloudflare Access self-hosted app on hub_pc.yjpark.org (hub page + /api/containers are unauthenticated), same policy as the ssh_* apps
- Verify in browser
Notes
- Blocked on re-authing the Cloudflare MCP with write scopes (tunnel config, DNS, Access apps); current session is read-only.
- Links/iframes on the hub point at *.pc.yjpark.org (ZeroTier IPs), so from outside only the hub page itself loads unless on ZeroTier.
- Underscore in a browser hostname: should work under the *.yjpark.org edge cert, but if not, fall back to hub-pc.yjpark.org.
Progress (2026-10-22)
- Access app 64e6e1d0-5371-494a-b5f8-21e8499ca571 (self_hosted, reuses the two allow-email policies from ssh_pc), created first so the hub was never exposed without login.
- DNS 75f51f75f92ef98de71cb40cb79c1b93: proxied CNAME to the tunnel.
- Tunnel config v4: hub_pc rule inserted before the 404 catch-all; ssh_pc rule untouched.
- https://hub_pc.yjpark.org/ answers 302 to the Access login, edge TLS verifies (the underscore is fine).
- Origin not checked from yolo (no route to the host Caddy); needs a browser login to confirm.
Summary of Changes
pc’s remote-managed tunnel now serves https://hub_pc.yjpark.org (tunnel rule → http://localhost:80 with Host hub.pc.yjpark.org, proxied CNAME, Access app reusing the ssh_pc email policies). Confirmed working in the browser after Access login. No repo changes; everything lives in Cloudflare.
Convert onecli-reseed to a manually-invoked script (flakes-2ey6)
Remove the systemd service for onecli-init-ca-and-secrets and replace with a plain onecli-reseed command. Launch is manual so systemd wantedBy/autostart causes more trouble than it’s worth.
Summary of Changes
- Renamed
initScript→reseedScriptwith binary nameonecli-reseed - Added
reseedScripttoenvironment.systemPackagesdirectly - Removed
systemd.services.onecli-init-ca-and-secretsblock entirely - Deleted
onecli-init-ca-and-secrets.bash(was justsudo systemctl start ...) - Removed auto-start block from
mise run _switch-host - Updated
mise run restart-oneclito callsudo onecli-reseeddirectly
Tidy up the shell title when running zellij (flakes-2fpy)
Objective
Configure zellij so the terminal emulator’s tab title (kitty/wezterm tab bar) shows the zellij session name instead of the verbose <cwd> | <last command with args> format zellij currently sets.
Context
When zellij runs inside a kitty or wezterm tab, it overwrites the terminal’s tab title with its own format: <current directory> | <last command with arguments>. This is too long for a tab bar and makes tabs hard to distinguish.
Fish shell’s fish_title is already configured to show just the current directory or last command name, and works correctly when zellij is not running. The problem is specifically that zellij overrides the terminal title with its own verbose format.
Requirements
- Configure zellij to set the terminal tab title to its session name (e.g. “main”, “dev”)
- Do not modify fish_title or other shell-level title configuration
- Zellij’s internal pane/tab titles (within zellij’s own UI) are out of scope and can remain as-is
Acceptance Criteria
- When zellij is running in a kitty or wezterm tab, the tab bar shows the zellij session name
- When zellij is not running, fish_title continues to work as before (current directory or last command name)
- No regressions in zellij’s internal tab/pane display
Summary of Changes
- : Return empty string when inside zellij — zellij’s
make_terminal_titlealready shows just the session name, so an empty pane title avoids duplication (was: echo $ZELLIJ_SESSION_NAME which produced.skills | .skills) - : Removed
zellij_update_tabname_pwd(PWD event hook) andzellij_update_panename_cmd(preexec event hook) — these were driving zellij’s verbose<cwd> | <command>terminal title format. Keptzellij_update_tabnamecall at startup only, which sets the zellij internal tab name to the initial directory once.
Revision: New Approach (2026-03-17)
Previous approach (empty fish_title inside zellij) broke zellij’s internal tab/pane renaming.
New approach: revert fish/zellij files to original, configure kitty and wezterm to extract just the session name (before ’ | ’) from the terminal title for display.
- Revert fish_title.fish to original
- Revert zellij.fish to original
- Update kitty tab_title_template to use partition(’ | ’)[0]
- Add wezterm format-tab-title event handler
Summary of Revised Changes
- Reverted to original (no ZELLIJ_SESSION_NAME check)
- Reverted to original (restored and hooks)
- Updated kitty to use — strips suffix, showing only the session name
- Added wezterm event handler that extracts text before using Lua pattern matching
Monitoring: shared topology module (hubs, roles, ports) (flakes-2gf7)
Shared NixOS module that defines the monitoring topology once, in the style of mixins/nixos/lan/site.nix, so hubs/agents derive their config from data instead of per-host copy-paste.
Spec
- Location:
mixins/nixos/services/monitoring/(opt-in mixin, imported by pc and edgerimports.nix). - Options (sketch):
monitoring.hubs— attrset of hub name → address, default{ pc = "pc.yjpark.zerotier"; edger = "edger.yjpark.zerotier"; }(zerotier names resolve/route from every site).monitoring.role.hub— bool; enables VM + VL on this host (see hub bean).monitoring.role.agent— bool, default true when the mixin is imported.- Ports as constants/options: VM 8428, VL 9428, node_exporter 9100, vlagent listen 9429 (localhost).
- Derived: list of VM remote-write URLs (
http://<hub>:8428/api/v1/write) and VL remote-write URLs (http://<hub>:9428/internal/insert) for all hubs — confirm the exact vlagent→VL ingestion path from VictoriaLogs docs/source. - Common labels:
host = config.networking.hostName,site = config.site.id.
Todo
- Create mixin with options + derived URL lists
- Import in
nixos/hosts/pc/imports.nixandnixos/hosts/edger/imports.nix -
mise run build-hostbuilds on both (verified via toplevel drv eval for pc and edger)
Summary of Changes
- Added
mixins/nixos/services/monitoring/default.nix(options only, no services yet):monitoring.hubs(default pc/edger →<host>.yjpark.zerotier),monitoring.role.{hub,agent},monitoring.ports.*, and read-only derivedlabels(host, plussitewhen the lan mixin is imported),vmWriteUrls(/api/v1/write) andvlWriteUrls(/internal/insert, verified in VictoriaLogs v1.49 vlinsert). role.hubdefaults tohubs ? hostName, so pc and edger are hubs automatically — flakes-4c4d does not need to set it per host.- Imported the mixin in pc and edger
imports.nix. - Verified: both toplevels evaluate; derived values checked via
nix eval. Drv diff vs HEAD is only the flake source path in home-manager files (no functional change).
Expose edger ingress hub via Cloudflare tunnel as hub_edger.yjpark.org (flakes-30pz)
Same as flakes-2ab4 (hub_pc), on edger’s remote-managed tunnel f62c3a91-d7b5-48c3-921d-f22e0f0cd0e9.
- Access app b6f86432-eb4c-4b66-b52e-602e893d3cde (self_hosted, the ssh_* allow-email policies), created first
- DNS 4b4a7de5ae2c02ef1c081c0d13e25118: proxied CNAME to the tunnel
- Tunnel config v2: hub_edger → http://localhost:80 with httpHostHeader hub.edger.yjpark.org, before the 404 catch-all; ssh_edger untouched
- Verified: public URL 302 to the Access login, edge TLS verifies; origin (http, Host hub.edger.yjpark.org) answers 200
Summary of Changes
https://hub_edger.yjpark.org now serves edger’s hub page behind Cloudflare Access. No repo changes; everything lives in Cloudflare.
Monitoring: VictoriaMetrics + VictoriaLogs hub on pc and edger (flakes-4c4d)
Run the storage + UI on each hub (pc, edger) when monitoring.role.hub = true.
Spec
services.victoriametrics: listen:8428, retention ~90d (tune), vmui at/vmui.services.victorialogs: listen:9428, retention ~30d (tune), UI at/select/vmui.- Access via zerotier only: zerotier is in firewalld
trusted, so no new firewall rules; do not add the ports tolan/public zones. Verify reachability from the other site. - Disk: check free space on pc (
/ext4,/homededicated disk) and edger; pickstateDiraccordingly. - Note: edger is on
versions/22.05.nixstateVersion — module is fine, but confirm no stateVersion-gated defaults bite.
Todo
- Enable VM + VL behind
monitoring.role.hub(mixins/nixos/services/monitoring/hub.nix; VM 90d, VL 30d capped at 20GiB; pc build OK, adds only VM/VL) - Set role on pc and edger (automatic: role.hub defaults to membership in monitoring.hubs)
- Verify both UIs reachable from the other host over zerotier
Notes
-
2026-10-07: edger (172.22.1.2) unreachable over zerotier from pc (ping 100% loss) — cross-site check pending until it is back.
-
Disk: pc / has 128G free (state lives under /var/lib/private on /). edger disk not checked yet (unreachable); VL capped at 20GiB via -retention.maxDiskSpaceUsageBytes.
-
lan zone already admits the site /24 on all ports, so hub UIs are reachable from the local site LAN as well as zerotier.
-
2026-10-07: pc switched; VM/VL /health, /vmui, /select/vmui all 200 locally and from edger over zerotier. Interactive shells with http_proxy and no no_proxy get 502 from clash — use –noproxy or bypass .yjpark.zerotier; system services are unaffected (cn/proxy-env only proxies nix-daemon/k3s/containerd).
-
edger disk: / 1.8T, 186G free (89% used) — 20GiB VL cap is fine.
Summary of Changes
mixins/nixos/services/monitoring/hub.nix: VictoriaMetrics (:8428, 90d) and VictoriaLogs (:9428, 30d, 20GiB cap) on hosts inmonitoring.hubs; retention configurable viamonitoring.retention.*.- Deployed on pc and edger (2026-10-07). Both hubs serve /health, /vmui, /select/vmui over zerotier.
- edger deploy: built on pc (displaylink zip and caddy plugin source copied from edger store, they cannot be fetched on pc) and copied with
nix copy; closure diff was monitoring-only.
Remove stateVersion mixin pattern, use defaults instead (flakes-5pbu)
Set default stateVersion in base configs, delete nearly-empty mixin files, fix fallback key mismatch in activate-home.nix
Summary of Changes
- Added
home.stateVersion = "25.05"toconfigurations/home/yjpark.nix - Added
home.stateVersion = "26.05"toconfigurations/home/yj.nix - Deleted nearly-empty host mixin files: alienware-13.nix, edger.nix, hp-g1.nix, pc.nix, and containers/yolo.nix
- Restored
mixins/home/containers/.gitkeepfor future use - Simplified
mixins/home/hosts/gpd-p2.nix: removed version import, kept only incus/edger.nix import - No change needed to activate-home.nix (the trailing
@on fallback key is required by nixos-unified; home-configs.nix omits it correctly as nixos-unified adds it internally)
Restructure home config host/container registration (flakes-6n5b)
Move host/container registration to mixins/home/hosts/ and mixins/home/containers/, update home-configs.nix and activate-home.nix accordingly
Summary of Changes
- Created files for alienware-13, edger, hp-g1, pc (each imports 25.05 version mixin)
- Updated to add 25.05 version import
- Created importing 26.05 version mixin
- Deleted
- Rewrote : removed
configDirparam,mixinDirnow serves both roles - Rewrote : reads host names from hosts/ and containers/ dirs; fixed fallback key (removed trailing @)
- Removed version imports from
configurations/home/yjpark.nixandconfigurations/home/yj.nix
Verified: nix eval .#homeConfigurations --apply 'x: builtins.attrNames x' returns expected keys.
Install latest beans via nix flake (flakes-6ne0)
Add beans (edger-dev/beans) as a flake input and install it as a home-manager package, replacing or supplementing the current beans installation.
Plan
Investigation (changes the approach)
- The bean assumed a flake input
edger-dev/beans. That repo 404s (private or nonexistent; no GitHub auth in this container). The real upstream isgithub.com/hmans/beans(from the binary’s Go module path). hmans/beansis public but has no flake.nix, so it can’t be a flake input directly.- Building from source is a two-stage pnpm + Go build:
internal/web/embed.gohas//go:embed dist/*which requires a pre-built SvelteKit frontend (pnpm build→ copy intointernal/web/dist/) beforego build. That needs two content hashes (pnpmDeps + goModules vendorHash) and is high-risk to converge unattended. - hmans/beans publishes prebuilt goreleaser binaries. Latest stable = v0.4.2, per-platform tarballs (Linux x86_64/arm64, Darwin x86_64/arm64). The Linux binary is static (
not a dynamic executable) and runs (beans 0.4.2). License: Apache-2.0. - The public release ships only
beans(CLI +beans tuisubcommand).beans-serve(web UI, embeds the frontend) is not published and is not a subcommand ofbeansv0.4.2 (beans serve→ unknown command). The current imperative install (from a private dev build) has all three:beans/beans-serve/beans-tui.
Decision
Package the prebuilt v0.4.2 beans release binary as a home-manager package via fetchurl (per-platform, hashes from the release checksums.txt). This is robust and verifiable, and honors the bean’s intent (manage beans declaratively via nix) better than the impossible flake-input or the fragile source build.
Scope note: this supplements — it adds nix-managed beans (CLI + TUI). It does not remove the imperative ~/.local/bin/{beans,beans-serve,beans-tui} and does not provide beans-serve (web UI), which the public release doesn’t publish. Packaging beans-serve would need the source build → separate follow-up.
Steps
- Added
packs/home/common/packages/beans.nix(prebuilt v0.4.2, per-platform fetchurl) +home.packagesentry - Built via nix-build; binary runs (
beans 0.4.2,tuisubcommand,list);homeConfigurations.yjnow contains beans-0.4.2 - Reviewed (subagent verified all 4 hashes vs upstream checksums, static-binary + darwin-signing concerns cleared) + committed
Summary of Changes
Added packs/home/common/packages/beans.nix: a home-manager module that installs the prebuilt v0.4.2 beans release binary from github.com/hmans/beans via per-platform fetchurl (x86_64/aarch64 × linux/darwin), hashes pinned from the release checksums.txt, added to home.packages.
Deviation from the original spec (documented in Plan): the bean named a flake input edger-dev/beans — that repo is inaccessible (404/private, no auth here) and the real upstream hmans/beans has no flake. Building from source is a two-stage pnpm+Go build (embedded SvelteKit frontend). The prebuilt release binary is the robust, verifiable path and matches the intent (declarative nix-managed beans).
Verified: nix-build succeeds; the binary runs (beans 0.4.2, beans tui, beans list); homeConfigurations.yj.config.home.packages contains beans-0.4.2; activation package evaluates. Review subagent confirmed all four asset hashes against upstream checksums and cleared static-binary/darwin-signing concerns.
Scope / follow-up: supplements (does not remove) the imperative ~/.local/bin/{beans,beans-serve,beans-tui}. beans-serve (web UI) is not in the public release; packaging it from source is tracked in follow-up bean flakes-qe0o. PATH precedence: if ~/.local/bin shadows the nix beans, remove the imperative copy to use v0.4.2.
Resolve username from host/container dir in activate-home.nix (flakes-7aac)
Replace flat knownHosts list with separate hosts/containers lists so activate-home.nix determines username (yjpark vs yj) from which dir the hostname is found in, rather than using $(id -un). Also update home-configs.nix fallback key to use ‘username@’ format.
Summary of Changes
- : replaced flat
knownHostswith separatehostsandcontainerslists; shell script now checks hosts first (→yjpark@$_host), then containers (→yj@$_host), falling back to$(id -un)@only when hostname is unknown home-configs.nix: updated fallback key from${username}to"${username}@"to match new shell script format
Remove spacebot and hermes containers (flakes-7g5s)
Remove spacebot and hermes entirely: container configs, home mixins, launch/restart scripts, abbrs, flake inputs (spacebot, hermes-agent, hermes-webui, opencode-claude-code-plugin), ingress entries, onecli script defaults, incus instances/images. Host data dirs ~/bots/{hermes,agents} are kept.
- Remove from repo
- Update flake.lock and build check
- Delete incus instance/images and activate host
Summary of Changes
Removed container configs, home mixins, incus launch/restart scripts, abbrs, the spacebot/hermes-agent/hermes-webui/opencode-claude-code-plugin inputs (lock pruned, nothing else updated), ingress entries (10.100.0.101/.102) and the onecli script defaults (now just yolo). Deleted the hermes incus instance + snapshot and the spacebot/hermes images (the spacebot instance was already gone). Kept host data in ~/bots/hermes and ~/bots/agents. Also skip .gitkeep in flake/home-configs.nix (it generated a bogus yj@.gitkeep config once the containers dir became empty). Switched edger + home; yolo switched natively via mise run _switch-host.
Setup markdown-oxide (flakes-7ih3)
For neovim, zed, vscode
Monitoring: MCP servers for agents (VictoriaMetrics + VictoriaLogs) (flakes-7o0r)
Give agents (Claude Code etc.) query access to metrics and logs.
Spec
- Official servers:
VictoriaMetrics-Community/mcp-victoriametricsandmcp-victorialogs(Go). Not in nixpkgs → package withbuildGoModule(local overlay/package in this repo; check how other custom packages are done here). - Decide deployment:
- (a) stdio MCP launched by the client (simplest; client config points
VM_INSTANCE_ENTRYPOINT/ VL URL at nearest hub over zerotier), installed via Home Manager; or - (b) HTTP/SSE MCP service on each hub (systemd), reachable over zerotier. Pick based on how containers’ Claude Code reaches hosts.
- (a) stdio MCP launched by the client (simplest; client config points
- Raw HTTP APIs (PromQL
/api/v1/query, LogsQL/select/logsql/query) are also usable directly by agents — document them. - Wire into Claude Code MCP config (home-manager).
Todo
- Package mcp-victoriametrics and mcp-victorialogs
- Choose stdio vs hub-hosted HTTP and implement
- Register in Claude Code config; test “which units failed on edger in the last hour?”
Configure & run ZeroClaw (config, secrets, service) (flakes-8itl)
Follow-up from flakes-kj17, which installed the ZeroClaw binaries (v0.8.2) via nix (packs/home/common/packages/zeroclaw.nix). This bean covers actually running/configuring ZeroClaw, which needs user decisions and secrets and so was deferred from the autonomous install.
ZeroClaw is a self-hosted autonomous AI assistant runtime: LLM providers (Anthropic/OpenAI/Ollama/…), channels (Discord/Telegram/Matrix/email/CLI), tools (shell/browser/http), configured via ~/.zeroclaw/config.toml.
Decisions needed
- Which LLM provider(s) + API keys — manage secrets via sops-nix (this repo’s pattern), not plaintext config
- Which channels/integrations to enable, and the autonomy level (this thing can run shell/tools — scope carefully)
- Run mode: on-demand CLI (
zeroclaw/zerocode) vs. an always-on service. Upstream ships a NixOS module (system service), not a home-manager service — decide host(s) and whether to use the upstream module or a home-manager systemd user service - Which machines should run it (currently the binary is in the common home profile → all profiles incl. containers; consider narrowing to a host mixin)
Tasks (once decided)
- Declarative
config.toml(home-managerhome.fileor xdg) with secrets wired via sops-nix - If service: import upstream NixOS module on the chosen host, or define a user service
- Verify a minimal end-to-end run (one provider, CLI channel)
Notes
- The release tarball also ships a
web/dist/dashboard copy; the static binary likely embeds its UI. If the web dashboard fails to find assets at runtime, packageweb/dist/alongside and point ZeroClaw at it. - To track latest: bump
version+sha256inzeroclaw.nixfrom the releaseSHA256SUMS.
Automate OneCLI CA push to containers on boot (flakes-aurl)
OneCLI CA cert gets wiped from container CA bundles on reboot/rebuild. Extend onecli-seed-secrets to also push the CA, and add wantedBy=multi-user.target + after=incus.service so it runs on every boot.
Design
Problem: init-ingress-ca on yolo copies system CAs to /var/lib/ingress/ca-bundle.crt on boot, wiping the OneCLI CA that was previously appended by onecli-push-ca. This breaks all HTTPS through the OneCLI MITM proxy (nix downloads, curl, git, etc.) until someone manually runs onecli-push-ca yolo.
Solution: Extend onecli-seed-secrets on edger (host) to:
- Fetch OneCLI CA from
http://10.100.0.1:10254/api/gateway/ca - Push to each running agent container via
incus file push - Append to CA bundles inside the container (handling Nix store symlinks + idempotency)
Also update the systemd service:
- Add
wantedBy = ["multi-user.target"]— runs on every boot - Add
after = [..., "incus.service"]— ensures incus is up
Files to modify:
mixins/nixos/services/onecli.nix— extend seeder script + service config
Known gap: Container-side nixos-rebuild switch resets CA bundles. User must re-run sudo systemctl start onecli-seed-secrets on host. Acceptable since container rebuilds are manual.
Tasks
- Add CA push logic to seeder script in onecli.nix
- Rename
onecli-seed-secretsservice toonecli-init-ca-and-secrets(systemd service + script name) - Add
wantedByandafterincus.service to systemd service - Add
onecli-init-ca-and-secretsshell script on host (starts the systemd service via sudo) for easy manual use - Update
onecli-check-proxy.basherror messages to suggest runningonecli-init-ca-and-secretson the host - Add CA bundle verification to check script: detect broken TLS (e.g. curl to github.com fails but
--noproxyworks) and surface a clear diagnosis - Update
_switch-hostin mise.toml to reference new service name - Verify build with
mise run build-host
Summary of Changes
mixins/nixos/services/onecli.nix— Renamed serviceonecli-seed-secrets→onecli-init-ca-and-secrets. Added CA push logic (fetch from API, push to containers, append to CA bundles with symlink handling + idempotency). AddedwantedBy = ["multi-user.target"]andafter = ["incus.service"]so it runs on every boot.mise.toml— Updated_switch-hostandrestart-oneclitasks to reference new service name.mixins/home/host/linux/scripts/incus/onecli-init-ca-and-secrets.bash— New host script for easy manual triggering.mixins/home/container/scripts/onecli-check-proxy.bash— Updated error messages to point toonecli-init-ca-and-secrets. Added TLS verification check that detects “proxy works but TLS fails” scenario and surfaces clear fix instructions.
Set up Incus across machines (flakes-bxl7)
Set up Incus (container/VM manager) across all machines.
Tasks
- Create
mixins/nixos/services/incus.nix— Incus daemon with KVM, directory storage pool, NAT networking - Create
modules/home/packages/incus.nix— Incus client package + fish completions - Create
mixins/home/settings/incus/edger.nix— sample remote config for edger.yjpark.org - Include mixin in at least one NixOS host to test (edger)
Decisions
- No multi-host clustering
- Both containers and VMs (KVM enabled)
- Directory-based storage pool
- No shell abbreviations for now
- macOS colima setup is a separate future task
Reference
See clarified/2026-03-15_setup-incus.md for full clarification notes.
Summary of Changes
- : Enables incus daemon with NAT bridge network (incusbr0), directory storage pool, KVM kernel modules, and adds yjpark to the incus-admin group
- : Installs incus client and sources fish completions via shellInit
- : Home activation script that registers edger.yjpark.org as an incus remote (idempotent, skips if already present; manual cert trust still needed)
- : Added incus service mixin to edger host
Auto-trigger tab completion after j abbr expands to mise run _ (flakes-c03b)
Replace _j_abbr function with _j_expand fish function that handles expansion and triggers completion automatically when in a mise directory. Bind Space to _j_expand.
Summary of Changes
- Removed abbreviation entry from (was using function)
- Replaced function with in : detects when command line is exactly , expands to + triggers completion in mise dirs, or otherwise; falls through to normal space + abbr expansion for any other input
- Added to bind Space to (both normal and insert/vi mode)
Monitoring: node_exporter + vmagent dual-write on each host (flakes-c6gm)
Metrics agent on every monitored host, dual-writing to all hubs.
Spec
services.prometheus.exporters.node: enablesystemdcollector (unit active/failed state) plus defaults (cpu, mem, fs, net, hwmon, pressure). Listen on localhost only.services.vmagent: scrape local node_exporter (and VM/VL self-metrics on hubs);remoteWrite.url= first hub, remaining hubs viaextraArgs-remoteWrite.url=...(nixpkgs module only takes one URL). Set-remoteWrite.tmpDataPathunder the state dir so per-URL queues persist across restarts / link outages; set a sane-remoteWrite.maxDiskUsagePerURL.- External labels:
host,site(from shared module). - Optional extra: smartctl exporter for disks (could be a follow-up).
Todo
- node_exporter with systemd collector
- vmagent with all hub URLs + persistent queue
- Verify both hubs see
up{host="pc"}andup{host="edger"} - Verify buffering — verified naturally: pc vmagent queued for edger ~30 min before edger hub existed; after edger came up it holds pc node samples from 14:28Z continuously (34 x 1m, no gap), queues drained to 0.
Notes
- 2026-10-07: pc switched (mixins/nixos/services/monitoring/agent.nix). pc hub has up{host=“pc”} for node/vmagent/victoriametrics/victorialogs, 870 node_systemd_unit_state series. Already surfaced: greetd.service failed on pc.
- instance relabelled to hostname (scrape address is 127.0.0.1 on every host). external_labels host/site from monitoring.labels.
- Queue to edger retrying until edger’s hub is deployed.
Summary of Changes
mixins/nixos/services/monitoring/agent.nix: node_exporter (systemd, processes collectors) and vmagent bound to localhost; vmagent writes to every hub URL with per-URL on-disk queues (1GB cap each), external labels host/site, instance relabelled to hostname. Hubs also scrape their own VM/VL.- Deployed and verified on pc and edger: both hubs show 5 targets up per host.
Migrate container IPs to new scheme (flakes-cjao)
Update static IPs: spacebot .102→.101, hermes .103→.102, ubuntu .101→.200. Update incus-ingress.nix, launch scripts, and dnsmasq config.
Summary of Changes
- Updated : spacebot .102→.101, hermes .103→.102
- Updated @onecli static block to point to 10.100.0.2 (anticipating OneCLI containerization)
- Note: ubuntu container IP (.101→.200) is managed imperatively via
incus config device override ubuntu eth0 ipv4.address=10.100.0.200
Move p2 host to site 102 (flakes-cva3)
p2 physically moved to site 102 (10.0.1.0/24). Switch its lan mixin import and move its hosts entries (.5 p2, .12 p2_wifi) from lan/401 to lan/102.
Summary of Changes
- nixos/hosts/p2/imports.nix: import lan/102 instead of lan/401
- Moved p2 (.5) and p2_wifi (.12) host entries from lan/401 to lan/102, keeping their last octets
- Verified: p2 site.subnet evaluates to 10.0.1.0/24; pc’s /etc/hosts now lists p2 at 10.0.1.5
Expose kudo on pc via Cloudflare tunnel as kudo_pc.yjpark.org (flakes-d9tk)
Same pattern as flakes-2ab4 (hub_pc): Access app reusing the ssh_pc email policies (create first), proxied CNAME to pc’s tunnel 829deb72-9870-4b61-9120-bf748d85fbd2, and a tunnel rule before the 404 catch-all.
Wait until kudo and the hub are working end to end. Then pick the origin: the kudo hub (services.hub, bound to 10.100.0.1:15400 and 172.22.1.9:15400, see mixins/nixos/services/kudo-hub.nix) or a Caddy route, and check whether kudo needs websockets or non-browser clients. A non-browser client needs an Access service token or a bypass policy.
Drop nixos-unified, use raw flake-parts (flakes-dght)
Replace nixos-unified.lib.mkFlake with flake-parts.lib.mkFlake. Separate host and container config namespaces. Rewrite home-configs.nix and activate-home.nix to own the logic directly. Keep autowire (from jig) for module discovery.
Plan
- Move host configs: configurations/nixos/{edger,a13,g1,p2,pc} → configurations/nixos/hosts/
- Move container configs: configurations/nixos/{yolo,spacebot,hermes} → configurations/nixos/containers/
- Rewrite flake.nix: use flake-parts.lib.mkFlake with explicit imports
- Rewrite modules/flake/toplevel.nix: remove nixos-unified imports
- Create modules/flake/nixos-configs.nix: explicit nixosConfigurations + nixosModules.default + homeModules.default + overlays
- Rewrite modules/flake/home-configs.nix: use home-manager.lib.homeManagerConfiguration directly
- Rewrite modules/flake/activate-home.nix: use home-manager switch –flake directly
- Remove nixos-unified from flake inputs
- Update mise.toml build tasks — no changes needed, output names unchanged
- Test: nix flake check (passes — niri hash mismatch is pre-existing, unrelated)
- Test: mise run build-host (on edger) — blocked by pre-existing niri hash issue
Summary of Changes
Completed in two commits:
-
fee9eea - Drop nixos-unified, use raw flake-parts
- Replaced nixos-unified.lib.mkFlake with flake-parts.lib.mkFlake
- Separated host/container configs into configurations/nixos/hosts/ and containers/
- Rewrote home-configs.nix, activate-home.nix to own the logic directly
- Removed nixos-unified flake input
-
f69f1fd - Restructure into packs/ with wireImportsRecursively
- Introduced packs/ directory with autowired module collections
- Added wireImportsRecursively to jig (1f1b27c)
- Removed 28 boilerplate default.nix files
- Merged modules/ and relevant mixins/ into packs/
- Retained mixins/ for opt-in pieces (services, versions, storage, lan)
- Deduplicated shared config (ai/, removed pass-through files)
Restructure lan mixins: per-site LANs plus separate cn concerns (flakes-dw38)
The lan/{cn,my} split no longer matches reality. All hosts are in CN, but
there are now three CN sites on different subnets, and site membership has
changed. Restructure so per-site LAN facts and CN-wide facts are separate
concerns.
Prerequisite for [[flakes-k0sx]], which needs a home for the declarative proxy
environment that also covers g1.
Why the current layout fails
mixins/nixos/lan/cn conflates concerns with different scopes:
| concern | real scope | currently in |
|---|---|---|
| firewall zone sources | per-site (was a blanket 10.0.0.0/16) | lan/{cn,my}/firewall.nix, byte-identical |
| bare short hostnames | per-site | lan/{cn,my}/hosts.nix |
| TUNA substituter | every CN host, LAN or not | lan/cn/mirrors.nix |
| proxy env (new) | every CN host, LAN or not | — |
Nothing under lan/* can reach g1, which imports no lan mixin at all — that
is what rules out putting the proxy env there.
Cross-site naming is already solved
packs/nixos/host/zerotier/zerotier.nix is autowired into every host and maps
each machine to <name>.yjpark.zerotier → 172.22.1.x. Those are flat,
site-independent, and route from anywhere. So per-site hosts.nix files carry
only their own subnet and cross-site access uses the ZeroTier names — a bare
name then never resolves to an address that cannot route.
ZeroTier addresses are not changing. edger stays 172.22.1.2 there while its
LAN address becomes 10.0.4.2.
Site inventory
Site names are the directory names; the leading digit matches the third octet.
Site 102 — 10.0.1.0/24
10.0.1.1 router
10.0.1.9 pc desktop
10.0.1.10 mbp-2012
10.0.1.11 mbp
pc is 10.0.1.9, confirmed against the live host (eno1 10.0.1.9/24,
default route via 10.0.1.1) and consistent with its ZeroTier 172.22.1.9.
10.0.1.2 was edger’s address at the old site, not pc’s.
Site 401 — 10.0.4.0/24
10.0.4.1 router
10.0.4.2 edger
10.0.4.3 imac
10.0.4.5 p2 gpd-p2
10.0.4.6 a13 alienware-13
10.0.4.12 p2_wifi gpd-p2_wifi
10.0.4.13 a13_wifi alienware-13_wifi
Host parts are preserved from the old 10.0.1.x numbering; only the third octet
changes.
Site 708 — 10.0.7.0/24
10.0.7.1 router
10.0.7.8 g1 hp-g1
Target layout
mixins/nixos/lan/
102/ { firewall.nix (10.0.1.0/24), hosts.nix }
401/ { firewall.nix (10.0.4.0/24), hosts.nix }
708/ { firewall.nix (10.0.7.0/24), hosts.nix }
mixins/nixos/cn/
mirrors.nix # moved from lan/cn/mirrors.nix
proxy-env.nix # new, see flakes-k0sx
Each host imports lan/<site> plus cn:
| host | site | imports |
|---|---|---|
| pc | 102 | lan/102 + cn |
| edger | 401 | lan/401 + cn |
| p2 | 401 | lan/401 + cn |
| a13 | 401 | lan/401 + cn |
| g1 | 708 | lan/708 + cn |
firewall.nix is split per site rather than hoisted, narrowing
services.firewalld.zones.lan.sources from 10.0.0.0/16 to each site’s own
/24. Strictly tighter, and safe because cross-site traffic arrives over
ZeroTier (172.22.0.0/16), which packs/nixos/container/firewall.nix and the
host configs already place in the trusted zone.
Autowire note: lan/cn/default.nix is wireImports ./. (non-recursive). Each
new site directory needs its own default.nix doing the same, and lan/ itself
must not get one, or it would pull every site into every host.
Live bug this uncovered
nixos/hosts/a13/samba.nix:21 has:
"hosts allow" = "10.0.1. 127.0.0.1 localhost";
"hosts deny" = "0.0.0.0/0";
a13 is now at site 401 (10.0.4.x), so every client on a13’s own LAN was
denied — its samba shares were unreachable, and ZeroTier (172.22.) was not
allowed either so cross-site access failed too.
Fixed ahead of this restructure: now 10.0.4. 172.22. 127.0.0.1 localhost,
verified by evaluating nixosConfigurations.a13. The prefix is still hardcoded,
so deriving it from mixins/nixos/lan/401 once that exists remains a task.
Entries being dropped
edger_wifi— edger is not on wifi any more. Remove10.0.1.127 edger_wifi(lan/my/hosts.nix) and172.22.1.14 edger_wifi.yjpark.zerotier(zerotier.nix).x1/thinkpad-x1— still in use and may appear at any site, but it is a Windows laptop, so it is deliberately not managed here for now. Remove from the hosts files and fromzerotier.nix(172.22.1.7). This is “unmanaged”, not “gone”.- stale
10.0.1.8 g1 hp-g1inlan/cn/hosts.nix— superseded by site 708.
Other changes
edgerandp2newly pick up the TUNA substituter, sincelan/myhad nomirrors.nix. Confirm that is wanted.packs/home/common/programs/fish/aliases.nix:13—set-proxy-edger_lan = "set-proxy 10.0.1.2 31102"is wrong on both address and port. Legacy, so delete rather than fix.- Verified there is no cross-host LAN service dependency to worry about:
mixins/nixos/services/nix-serve.nixon edger hasopenFirewallbut no host declares it as a substituter, and cross-host incus goes to*.yjpark.org:8443over ZeroTier.
Summary of Changes
Implemented with a shared module plus per-site data, rather than three
copy-pasted firewall.nix/hosts.nix pairs as originally specced. The
duplication the first sketch would have created is what motivated the change,
and it is also what makes the a13 samba fix derivable.
mixins/nixos/lan/site.nix (new)
Defines a site option set and everything derived from it:
site.id— e.g."401", also the mixin directory namesite.octet— third octet of the10.0.N.0/24subnetsite.hosts— host part → names, for this site onlysite.prefix/site.subnet— read-only, derived ("10.0.4.","10.0.4.0/24")
From those it generates networking.extraHosts (sorted numerically by host
part, so the output is stable and diffable) and the services.firewalld.zones.lan
definition. Adding a site is now data only.
mixins/nixos/lan/{102,401,708}/default.nix (new)
Each imports ../site.nix and supplies only its data. No logic.
mixins/nixos/cn/ (new)
mirrors.nix moved here from lan/cn/ unchanged. This is where
[[flakes-k0sx]] adds proxy-env.nix.
Other
- All five hosts import
lan/<site>+cn.g1, which previously imported nolanmixin at all, now getslan/708+cn. nixos/hosts/a13/samba.nixuses${config.site.prefix}rather than a literal prefix, so moving a13 between sites cannot reintroduce the bug.packs/nixos/host/zerotier/zerotier.nix: droppedx1(172.22.1.7) andedger_wifi(172.22.1.14), with a comment recording that x1 is unmanaged rather than gone.- Deleted
mixins/nixos/lan/{cn,my}/and theset-proxy-edger_lanalias.
Verification
All five host configs evaluate and dry-run build. Per-host results:
| host | site | lan sources | own-subnet /etc/hosts entries |
|---|---|---|---|
| pc | 102 | 10.0.1.0/24 | router, pc, mbp-2012, mbp |
| a13 | 401 | 10.0.4.0/24 | router, edger, imac, p2, a13, p2_wifi, a13_wifi |
| edger | 401 | 10.0.4.0/24 | same as a13 |
| p2 | 401 | 10.0.4.0/24 | same as a13 |
| g1 | 708 | 10.0.7.0/24 | router, g1 |
- a13’s samba renders
hosts allow = 10.0.4. 172.22. 127.0.0.1 localhost. - All five hosts list the TUNA substituter ahead of
cache.nixos.org.
Diffed against pc’s live state, the only host inspectable from here. pc’s
/etc/hosts loses imac, p2, a13, x1, g1, p2_wifi and a13_wifi at
10.0.1.x — every one of those was wrong, pointing at addresses that no
longer exist at site 102. It keeps router, pc, mbp-2012, mbp.
Note on firewalld zone matching
On pc, eno1 (its active LAN interface) is currently in the public zone,
not lan; only wlp7s0 is a lan interface. LAN traffic therefore reaches the
lan zone by source match, which still holds after narrowing to /24, so
the change is safe.
Worth knowing separately: nixos/hosts/pc/host.nix declares
zones.lan.interfaces = [ "wlp7s0" "eno1" ], so after the next switch eno1
joins the lan zone and its interface match opens ports 1-65535 to anything on
that segment regardless of source. That is pre-existing declared behaviour, not
introduced here, but it means the source narrowing tightens only one of the two
paths.
Tasks
- Create
mixins/nixos/lan/{102,401,708}/— implemented as a sharedlan/site.nixplus per-site data, see Summary of Changes - Create
mixins/nixos/cn/and movemirrors.nixinto it - Update all five hosts’
imports.nixtolan/<site>+cn - Drop
edger_wifiandx1fromhosts.nixfiles and frompacks/nixos/host/zerotier/zerotier.nix - Fix
nixos/hosts/a13/samba.nix— allow10.0.4.and172.22.(done ahead of the restructure; still a hardcoded prefix) - Derive a13 samba
hosts allowfrom the site mixin (config.site.prefix) instead of the hardcoded prefix - Delete
mixins/nixos/lan/my/andmixins/nixos/lan/cn/ - Delete the legacy
set-proxy-edger_lanalias - Confirm edger/p2 should get the TUNA substituter — all hosts are CN now, so all five get it
- Build all five host configs and diff
/etc/hosts+ firewalld zones against the current generations - After switching, verify same-site LAN access still works on each host (the firewall narrowed from /16 to /24)
Ingress hub on p2, exposed as hub_p2.yjpark.org (flakes-gb22)
p2 has no hub yet: mixins/nixos/services/incus-ingress is only imported on pc and edger. Deferred on 2026-10-22.
What it takes
- Make
ingress.containersin the incus-ingress mixin overridable (it hardcodes onecli/searxng/yolo); p2 gets[]unless it runs containers - Import incus-ingress in nixos/hosts/p2/imports.nix; add p2 to
ingress.sites(packs/nixos/host/ingress.nix) - DNS:
*.p2.yjpark.orgA record → 172.22.1.5 (ZeroTier, unproxied), like pc/edger - Switch p2; check hub.p2.yjpark.org over ZeroTier
- Cloudflare, same as flakes-2ab4: Access app (ssh_* allow-email policies) first, proxied CNAME hub_p2 → p2’s tunnel, tunnel rule → http://localhost:80 with httpHostHeader hub.p2.yjpark.org
Notes
- The only hub service on p2 today is clash (
ingress.servicesevaluates to [“clash”]); incus is enabled. - The cloudflare-caddy secret (mixins/nixos/services/secrets/cloudflare-caddy.txt) is already encrypted for p2’s age key.
- p2 is a CN host: Caddy needs the clash proxy env for Let’s Encrypt (mixins/nixos/cn/proxy-env.nix already covers it).
Unify terminal theme to Tokyo Night (flakes-hncv)
Switch wezterm from Gruvbox Dark to Tokyo Night theme, and update Zellij pane background color palette from Gruvbox-adjacent tints to Tokyo Night-adjacent tints. Kitty already uses tokyo_night_night.
Summary of Changes
- wezterm: Changed
color_schemefromGruvbox Dark (Gogh)toTokyo Nightinmixins/home/gui/linux/wezterm/wezterm.lua - Zellij pane colors: Updated palette in
modules/home/programs/fish/init/zellij.fishfrom Gruvbox-adjacent tints (base#282828) to Tokyo Night-adjacent tints (base#1a1b26)
All terminal themes now unified on Tokyo Night: kitty (tokyo_night_night), wezterm (Tokyo Night), Zellij (tokyo-night-dark), and pane background tints.
Remove k3s from all hosts (flakes-itu2)
k3s is no longer needed anywhere. Remove it from every host’s config, tear down its runtime state, and drop Kubernetes tooling from the home config.
State found (2026-10-07)
| Host | k3s | Workloads |
|---|---|---|
| pc | running | cert-manager, stale clash + yacd (replaced by host mihomo, flakes-k0sx), minio (empty: only .minio.sys, 120K) |
| edger | running | cert-manager, stale clash + yacd |
| a13 | running | cert-manager, clash + yacd, minio in ImagePullBackOff (1K volume) |
| p2 | inactive | — |
| g1 | offline | unknown — picks up the change on its next switch |
No repo references to the clash NodePorts (3110x) or minio remain. No data to preserve.
Decisions
- Wipe k3s state on each deployed host (
k3s-killall.sh, then/var/lib/rancher,/etc/rancher,/var/lib/kubelet, CNI leftovers). - Remove generic kubectl bits from home config too (
kabbr,KUBECONFIG). - Deploy now to pc, edger, a13, p2 — diff each closure first, stop if unrelated changes come along.
- Supersedes flakes-jspq (minio has no data, nothing to migrate).
Todo
- Delete
mixins/nixos/ext4(k3s only) and its imports on pc/edger - Delete
mixins/nixos/zfs/k3s.zfs.nix(k3s + containerd for it); keep zfs scripts - Drop k3s/containerd branches from
mixins/nixos/cn/proxy-env.nix - Remove
copy-k3s-yaml.bash,k/knabbrs (fish + nushell),KUBECONFIG,k8s.nix(kubectl, kubectx, kubeshark, kubespy, kompose, kubevela),k9s.nix - Update monitoring comment that mentions k3s pods (also incus-ingress traefik-disable flag, egress-proxy comment)
- Evaluate all five hosts (k3s + containerd disabled on all; home configs yjpark/yj evaluate)
- Deploy + clean up pc (diff removals only; k3s-killall.sh, switch, wiped /var/lib/rancher 2.6G, /etc/rancher, /var/lib/kubelet, /run/k3s, /run/flannel, ~/.kube)
- Deploy + clean up edger (built on pc, diff removals only; wiped /var/lib/rancher 5.5G)
- Deploy + clean up a13
- Deploy + clean up p2
- Close out flakes-jspq and k3s leftovers in flakes-k0sx
Summary of Changes
- Config: removed
mixins/nixos/ext4(k3s only) andmixins/nixos/zfs/k3s.zfs.nix(k3s + standalone containerd on the ZFS snapshotter), k3s/containerd branches ofcn/proxy-env.nix, the incus-ingress traefik flag, and Kubernetes tooling from home (k8s.nix, k9s.nix, copy-k3s-yaml, k/kn abbrs, KUBECONFIG). k3s and containerd now disabled on all five hosts. - Deployed to pc, edger, a13, p2 (each built on pc, closure diff removals only, copied with nix copy). Teardown: k3s-killall.sh, then state dirs and ~/.kube removed.
- a13/p2 ran a standalone containerd that k3s-killall.sh does not touch: pod shims kept running after the switch. Killed via the kubepods cgroup, unmounted leftovers,
zfs destroy -r rpool/state/containerd. Teardown script recorded in flakes-x7wb. - Before removal on a13/p2, confirmed host mihomo active and nix-daemon proxied via 127.0.0.1:21102, so dropping the k3s clash broke nothing.
- g1 was offline: follow-up flakes-x7wb.
Replace autowire.nix with jig lib (flakes-iymi)
Migrate from standalone autowire.nix flake input to jig’s lib.autowire. Add shim in flake.nix, rename default→wireImports, fix generic gatherFiles calls, update docs.
Summary of Changes
- Replaced
autowire.url = "github:yjpark/autowire.nix"withjig.url = "github:edger-dev/jig"in flake.nix - Added shim:
inputs = inputs // { autowire = inputs.jig.lib.autowire; }so all existingflake.inputs.autowire.*references keep working - Renamed
autowire.default→autowire.wireImportsin 48 default.nix files - Updated 3 files using generic
gatherFiles→gatherFiles_(pre-applied variant) - Updated CLAUDE.md and docs/src/architecture.md
- Verified with
nix flake show— evaluates cleanly
wezterm: Claude Code editing ergonomics (shipped) (flakes-jkwu)
Two wezterm ergonomics tweaks for Claude Code, already shipped in packs/home/gui/linux/wezterm/wezterm.lua. Captured for the record.
1. Ctrl+\ → soft newline in Claude Code
Send Space \ <50ms delay> Enter so CC inserts a continuation line instead of submitting. The delay matters — without it a stray \ is left on the last line.
{ key = '\\', mods = 'CTRL', action = wezterm.action_callback(function(window, pane)
window:perform_action(act.SendKey { key = 'Space' }, pane)
window:perform_action(act.SendKey { key = 'Backslash' }, pane)
wezterm.sleep_ms(50)
window:perform_action(act.SendKey { key = 'Enter' }, pane)
end)},
2. Don’t let Ctrl+Shift+C clobber the zellij/OSC-52 clipboard
Through wezterm → remote shell → zellij, Ctrl+Shift+C ran CopyTo('Clipboard') which copied the (empty) terminal selection, overwriting what zellij had already put on the system clipboard via OSC 52. Fix: make the binding a callback that only copies when there is a non-empty terminal selection (mirrors kitty’s behavior). Upstreamable.
Status
Both bindings are present in wezterm.lua (lines ~60–74). This bean documents them; no further work unless upstreaming the Ctrl+Shift+C fix.
Todo
- Ctrl+\ soft-newline binding
- Ctrl+Shift+C clipboard-safe binding
- (optional) Upstream the Ctrl+Shift+C selection-guard behavior to wezterm
Set up firewalld as NixOS service and migrate existing firewall rules (flakes-jvmx)
Objective
Replace NixOS’s built-in networking.firewall with firewalld across all hosts, enabling zone-based firewall management that integrates natively with incus.
Context
The repo currently uses NixOS’s networking.firewall — a simple declarative wrapper around iptables/nftables. This works for basic port allowlisting but doesn’t support zone-based policies. With incus now in the stack (mixins/nixos/services/incus.nix), zone-based rules are a better fit:
- Incus has built-in firewalld support — it can automatically manage zones for bridge interfaces (
incusbr0), so containers/VMs get proper network isolation without manual rules. - Already on nftables —
networking.nftables.enable = trueis set in the incus mixin. firewalld uses nftables as its default backend, so there’s no backend conflict. - Current LAN rules use raw iptables — the
extraCommandsinmixins/nixos/lan/*/firewall.nixinject iptables rules directly, which won’t work under firewalld’s managed ruleset. - Zone-based model is cleaner — instead of scattering port ranges across files, interfaces get assigned to zones with appropriate policies.
Requirements
1. Enable firewalld as a NixOS service
- Set
services.firewalld.enable = truein an appropriate NixOS module - This automatically disables
networking.firewall— both cannot be active simultaneously
2. Migrate all existing networking.firewall usages
The following files need migration:
| File | Current rules | Migration approach |
|---|---|---|
mixins/nixos/lan/my/firewall.nix | Open ports 1000-65535 for 10.0.0.0/8 (iptables) | Create a zone (e.g., “lan”) with these rules, assign LAN interface |
mixins/nixos/lan/cn/firewall.nix | Same as above | Same zone approach |
mixins/nixos/dev/ports.nix | TCP ranges 3000-3999, 8000-8999, 29000-29999 | Add port ranges to appropriate zone |
modules/nixos/services/airplay.nix | TCP 7000,7001,7100 + UDP 6000,6001,7011 | firewalld service definition or rich rules |
modules/nixos/services/clash-verge.nix | TCP ports for clash | firewalld service or zone rules |
modules/nixos/services/zerotierone.nix | UDP port for zerotier | firewalld service or zone rules |
mixins/nixos/ext4/k3s.ext4.nix | k3s TCP ports + ranges | firewalld zone for k3s |
mixins/nixos/zfs/k3s.zfs.nix | k3s TCP ports + ranges | firewalld zone for k3s |
configurations/nixos/alienware-13/ports.nix | TCP 2342 (photoprism) | firewalld service or zone rule |
3. Configure incus integration
- Ensure
incusbr0bridge interface is assigned to an appropriate firewalld zone - Verify incus can manage its own firewall rules through firewalld without manual intervention
4. Design the zone layout
Decide on zones — at minimum:
- public (default) — external-facing interface, restrictive
- trusted or custom lan zone — for
10.0.0.0/8traffic with broader access - incus zone — for
incusbr0, managed by incus
Acceptance Criteria
-
services.firewalldis enabled andnetworking.firewallis no longer used - All previously open ports/ranges remain accessible in the correct contexts
- LAN-scoped rules (
10.0.0.0/8broad access) work via firewalld zones instead of raw iptables - Incus containers/VMs have working network access through
incusbr0 - No regressions — services (airplay, clash-verge, zerotier, k3s, photoprism) remain reachable
-
nix fmtpasses on all changed files
Dependencies
- Depends on incus being configured (already done in
mixins/nixos/services/incus.nix) - Hosts not using incus should still work with firewalld (zone config just won’t include incus zone)
Setup quartz to preview and publish oxide projects (flakes-k391)
Blocked — needs spec (triaged 2026-06-29, night shift)
The bean has no body and the approach can’t be determined without guessing on several independent axes. Context found: ‘oxide projects’ most likely refers to markdown-oxide notes (the Obsidian-style markdown PKM enabled in [[flakes-7ih3]] via the markdown_oxide LSP — but no vault path is configured anywhere in the repo).
Quartz (https://quartz.jzhao.xyz) is a static-site generator that publishes a folder of Obsidian/markdown notes. It’s structured as a per-content project scaffold (clone quartz, put markdown in content/, npx quartz build/preview), not a home-manager package — so this is a project/workflow setup, not a dotfiles config change.
Open questions blocking implementation
- Content source: which markdown directory/vault are the ‘oxide projects’? Where does it live (path / separate git repo / the private/ dir)?
- Repo location: should the Quartz project live in this flakes repo, a sibling repo, or inside the notes vault?
- Publish target: GitHub Pages? Cloudflare Pages? The existing host Caddy ingress (
*.${host}.yjpark.org, seemixins/nixos/services/incus-ingress.nix)? Cloudflared tunnel? This drives the whole ‘publish’ half. - Preview: local
npx quartz build --serveis generic; fine once content path is known.
Proposed approach (once unblocked)
- Scaffold Quartz pointing
content/at the vault (or symlink); add amise/just task forpreview; pick a publish target and add a build+deploy task (or a NixOS/cloudflared service if self-hosting). Optionally add thequartz/node toolchain to a dev shell.
Moved to draft so it leaves the ready queue until the content source + publish target are decided.
Check MCPVault, to see whether it’s a better option for the markdowns (flakes-k3pr)
Evaluation (research, 2026-06-29)
MCPVault = bitbonsai/mcpvault (site: mcpvault.org) — a TypeScript/Node (≥18) MCP server that gives MCP-compatible AI agents safe read/write access to a folder of markdown files (no Obsidian needed). Exposes ~14 tools: read/write/patch/move notes, BM25 search_notes, frontmatter get/update (AST-aware YAML preservation), tags, vault stats; with path-traversal protection. Run via npx @bitbonsai/mcpvault@latest /path/to/vault.
Is it a ‘better option for the markdowns’?
No — it’s a different layer, not a replacement. It does not compete with the current setup:
markdown-oxide(LSP) serves you in the editor (completion, backlinks, go-to-def). [[flakes-7ih3]]beansCLI manages the.beans/issue markdowns for you + agents.- MCPVault serves AI agents structured access to a notes vault. Complementary to markdown-oxide; largely redundant with
beansfor the.beans/dir (beans already has a CLI/GraphQL).
NixOS feasibility
Not in nixpkgs; it’s an npm package. Cleanest integration = register as an MCP server pointing npx at the notes vault; no system packaging needed.
Verdict
The bean’s ‘better option’ framing is a false either/or. Recommendation: keep markdown-oxide; optionally TRIAL MCPVault as an MCP server against the notes vault to give agents note access. Not urgent, not a replacement.
Sources: github.com/bitbonsai/mcpvault, mcpvault.org/install
Summary of Changes
Research/evaluation task (no code changes). Identified MCPVault as bitbonsai/mcpvault (Node MCP server for markdown vaults). Conclusion: not a ‘better option’ — it’s a complementary AI-agent access layer, not a replacement for markdown-oxide or beans. Recorded full assessment + sources above. Optional trial captured as a follow-up draft bean.
Install Zeroclaw (flakes-kj17)
Install Zeroclaw (https://github.com/zeroclaw-labs/zeroclaw) — evaluate and set up in the environment.
Plan
Evaluation (research + verified, 2026-06-29)
ZeroClaw (github.com/zeroclaw-labs/zeroclaw, MIT/Apache-2.0) is a single-binary Rust self-hosted autonomous AI assistant runtime (LLM providers + channels + tools; TOML config at ~/.zeroclaw/config.toml). Latest release v0.8.2.
Availability (verified): in nixpkgs as zeroclaw but stale (0.5.1); upstream flake has packages.<sys>.zeroclaw (but compiles a large Rust workspace, and packages.default is the Rust toolchain, no apps); prebuilt release binaries + SHA256SUMS for all platforms.
Decision
Package the prebuilt v0.8.2 release binary via fetchurl (same pattern as beans.nix / flakes-6ne0). This gives the latest version with no heavy Rust build and no new flake input — strictly better than the stale nixpkgs build and lighter than building the upstream flake from source. Use the musl (static) linux builds (no patchelf/loader concerns on NixOS).
Platforms: x86_64-linux, aarch64-linux (musl), aarch64-darwin. No x86_64-darwin asset is published → unsupported (throw).
Scope: install the zeroclaw (+ zerocode) binaries only. Runtime ‘setup’ (config.toml, API-key secrets, optional systemd service) needs user decisions → deferred to a follow-up. The web dashboard ships a web/dist/ copy in the tarball; the static binary most likely embeds its UI, so only the binaries are installed (caveat noted).
Steps
- Added
packs/home/common/packages/zeroclaw.nix(prebuilt v0.8.2 musl/darwin fetchurl) + home.packages - nix-build OK;
zeroclaw 0.8.2runs (zeroclaw + zerocode installed); present in homeConfigurations.yj - Self-reviewed (same verified pattern as beans.nix flakes-6ne0); committed; follow-up bean created for runtime config/secrets/service
Summary of Changes
Added packs/home/common/packages/zeroclaw.nix: home-manager package installing the prebuilt ZeroClaw v0.8.2 release binaries (zeroclaw + zerocode) via per-platform fetchurl (x86_64-linux/aarch64-linux musl-static, aarch64-darwin), hashes pinned from the release SHA256SUMS.
Why prebuilt: nixpkgs zeroclaw is stale (0.5.1) and the upstream flake compiles a large Rust workspace; the prebuilt static binary gives the latest with no heavy build and no new flake input (same pattern as beans, flakes-6ne0).
Verified: nix-build succeeds; zeroclaw 0.8.2 runs; both binaries installed; present in homeConfigurations.yj.
Scope: binaries only. Runtime setup (config.toml, API-key secrets via sops-nix, optional service, host targeting) is deferred to follow-up flakes-8itl — it needs user decisions and secrets, inappropriate for autonomous setup.
Fix CA cert injection to be declarative (flakes-krtw)
Replace manual /etc/ssl/certs mutation with security.pki.certificateFiles. Seeder pushes CA to a known path, NixOS handles cert bundle integration.
Summary of Changes
packs/nixos/container/onecli-proxy.nix: added/var/lib/onecli/tmpfiles dir,onecli-ca-bundle.service(oneshot, rebuilds bundle idempotently from system certs + CA), andonecli-ca-bundle.path(watches/var/lib/onecli/ca.crt, re-triggers on every push/rotation). UpdatedNODE_EXTRA_CA_CERTSto point to the new stable path.mixins/nixos/services/onecli.nix: seeder now writes CA to/var/lib/onecli/ca.crtonly — no more in-container symlink replacement or bundle appending.packs/home/host/linux/scripts/incus/onecli-push-ca.bash: same simplification.
Monitoring: journald → vlagent dual-write log shipping (flakes-m1as)
Ship journald from every monitored host to all hubs.
Spec
- Package:
pkgs.victorialogs.override { withVlAgent = true; withServer = false; }(vlagent not built by default). - Custom systemd unit
vlagent(no NixOS module exists):DynamicUser,StateDirectory, listen127.0.0.1:9429,-remoteWrite.urlonce per hub,-tmpDataPathin state dir for per-URL persistent queues. services.journald.upload:settings.Upload.URL = "http://127.0.0.1:9429/insert/journald"(vlagent accepts the journald protocol via vlinsert handler — verified in v1.49 source).- Stream fields: set
-journald.streamFields(e.g._HOSTNAME,_SYSTEMD_UNIT,PRIORITY) on the hub VL or vlagent — check which side applies them when forwarding. - Add
host/sitefields if not already carried by_HOSTNAME.
Todo
- vlagent package override + systemd unit
- journald upload → local vlagent
- Verify in both hub UIs:
_SYSTEMD_UNIT:sshd.servicefrom both hosts - Verify buffering across a hub outage
Summary of Changes
mixins/nixos/services/monitoring/logs.nix:systemd-journal-upload→ localvlagent(127.0.0.1:9429, built viavictorialogs.override { withVlAgent = true; }, custom unit since there is no NixOS module) → every hub’s VictoriaLogs, per-URL disk queue (1GB cap each).- Hub ingest URL corrected to
/insert/native(vlagent’s documented endpoint;/internal/insertis the cluster-internal protocol). - Stream fields: vlagent applies them itself; defaults
_MACHINE_ID,_HOSTNAME,_SYSTEMD_UNITkept. No extra host/site fields:systemd-journal-uploadappends/uploadto its URL so query-string extra fields are not an option, and_HOSTNAMEalready identifies the host. - First-start backfill limited to the retention window: an
ExecStartPreseeds the upload cursor at the last entry older thanmonitoring.retention.logs(30d), instead of pushing the full ~4G journal (back to May on pc) across sites only for hubs to discard it. - Deployed on pc and edger (2026-10-08). Backfill finished in ~90s: both hubs hold edger ≈7.3M and pc ≈3.3M entries for 30d; ~138M on disk per hub.
- Verified:
_SYSTEMD_UNIT:sshd.servicereturns both hosts on both hubs; buffering — stopped edger’s VictoriaLogs, logged a marker on pc (vlagent retried), restarted, marker reached edger ~6s later.
Monitoring: vmalert health rules (per-site, no double alerts) (flakes-me6e)
Health rules on top of the metrics — deferred until the base pipeline is in.
Spec
services.vmalerton each hub, evaluating only its own site’s hosts (filter bysitelabel) to avoid double alerts from replicated data.- Starter rules: host down (
up == 0), anynode_systemd_unit_state{state="failed"} == 1, disk > 85%, memory pressure, clock skew. - Notifier: TBD (ntfy? existing channel?) — decide before implementing.
Todo
- Decide notification target
- vmalert per hub with site filter + starter rules
Update CLAUDE.md to reflect current state (flakes-nyvs)
Fix outdated command names, module descriptions, overlays, flake inputs, and add Home Manager activation subsection
Summary of Changes
- Fixed → On branch dev
Changes not staged for commit:
(use “git add
…” to update what will be committed) (use “git restore …” to discard changes in working directory) modified: CLAUDE.md modified: flake.lock
Untracked files:
(use “git add
no changes added to commit (use “git add” and/or “git commit -a”)
- Fixed build-host description: “dry run” → “builds without switching”
- Simplified modules/ description (removed stale subdirectory list)
- Simplified mixins/ description (removed specific version numbers)
- Simplified configurations/ description (removed stale “plus version and platform mixins”)
- Fixed overlays/default.nix description: autowires from
./not./packages/ - Added Desktop/UI flake inputs group: claude-desktop, niri, xremap-flake, antigravity, jjui
- Added Home Manager Activation subsection covering yjpark/yj profiles, host/container mixin dirs, activate-home.nix logic, and home-configs.nix structure
Setup colima with incus (flakes-o04s)
Add edit-in-place script (flakes-oh4v)
Create modules/home/scripts/edit-in-place.bash to back up and replace home-manager managed symlinks with writable copies for local testing
Summary of Changes
Created modules/home/scripts/edit-in-place.bash — autowired automatically. Script backs up the symlink to .bak, removes the symlink, copies .bak back as a regular file, and sets 644 permissions.
Add GitHub token via OneCLI + container git config (flakes-oi2x)
Add GitHub fine-grained token to OneCLI for transparent auth injection into yolo container. Add container-specific git config to rewrite SSH URLs to HTTPS.
Summary of Changes
mixins/nixos/services/onecli.nix— AddedGITHUB_TOKENsecret config with*.github.comhost pattern andAuthorization: token {value}injectionmixins/home/container/git.nix— New file: rewrites SSH GitHub URLs to HTTPS (routes through OneCLI proxy) and setsGIT_TERMINAL_PROMPT=0mixins/nixos/services/secrets/onecli-secrets.txt— User needs to add real token viasops
Refactor ai.nix into ai/ directory (flakes-ojyn)
Convert mixins/home/host/common/ai.nix into a folder (ai/), moving scripts/installs/ under ai/installs/ and extracting inline scripts into bash files.
Summary of Changes
- Converted
mixins/home/host/common/ai.nix→ai/directory ai/default.nix: autowire pattern for extensibilityai/ai.nix: package declarations (bun, nodejs_25)ai/installs/default.nix: gatherScriptPackages_bash- Moved
scripts/installs/install-claude-mcp-context7.bashandinstall-claude-mcp-verena.bash→ai/installs/ - Extracted inline clone-beans and install-ccline scripts into
ai/installs/ - Removed
scripts/installs/directory (now empty)
Host-desktop: callback forward + xdg-open auto-open (flakes-ok62)
Host-desktop (Case 1) side of flakes-mqe9. The human is at the host Linux desktop; incus exec into the container.
Callback (needed for Phase A too)
- Host forward
127.0.0.1:3118 → 10.100.0.100:3118(socat or systemd-socket-proxyd unit) so the desktop browser’slocalhost:3118/callbackreaches the container Caddy bridge → CC. Lives in a host (Linux) mixin.
Phase B — zero-click auto-open
- Host
systemd --userlistener bound to the incus bridge IP that runsxdg-open <url>in the graphical session; authenticate with a shared secret. - Container
$BROWSER(Phase A script) gains ahost-desktoproute: POST URL+secret togateway:OPEN(gateway =ip -4 route show default). - Attach wrapper detects local desktop (
WAYLAND_DISPLAY/DISPLAY, noSSH_CONNECTION) and injectsBROWSER_ROUTE=host-desktop.
Bind the host listener to the incus bridge address (incus network get incusbr0 ipv4.address).
MITM egress-proxy CLI: stable CA + ease-of-use (reference) (flakes-p2dp)
Lessons from making a corporate egress-proxy CLI stable + easy to use. The tool MITMs all outbound HTTPS through a local proxy with its own CA. Patterns generalize to “any MITM-proxy-with-rotating-CA” setup.
Note on scope: this is a work-specific corporate tool that does not live in this flakes repo. Captured here as a reference bean for the lessons learned; the analogous in-repo pattern is the ingress CA bundle handling in mixins/nixos/services/incus-ingress.nix. Not directly implementable in this repo — treat as reference / draft.
Lessons
- CA must come from the real signing cert, not the management API. The proxy’s
/api/gateway/caendpoint can report a CA that does not match what it actually signs MITM certs with (regenerated-after-restart vs the persisted volume CA). Read the CA from the on-disk signing cert (.../gateway/ca.pem) instead. That one is stable (10-yr, survives restart/reboot; changes only on container recreate). - Persist the CA across recreate. Back the proxy’s data dir with a dedicated incus custom storage volume (bind-mounted), so CA + encryption key survive
delete+recreate. Verified: CA hash unchanged across a full recreate. - The ingress CA bundle gets clobbered — re-append on every rebuild. The dynamic ingress-config generator rebuilds the world-readable
ca-bundle.crtascat system + caddyon every port change, silently dropping the proxy CA that a separate service had appended. Net effect: TLS works right after boot, then breaks mid-session when a port change re-triggers ingress-sync. Fix: append the proxy CA inside the generator itself. (git/libcurl readsSSL_CERT_FILE/NIX_SSL_CERT_FILE-> the bundle, so once the CA is in the bundle, no per-commandhttp.sslCAInfoflag is needed.) - git push over the proxy: the proxy CA must be in the world-readable bundle; the root-only
ca.crt(mode 000) isn’t readable by the non-root user. - Ease-of-use wins: rewrite
git@host:...SSH URLs to HTTPS in container git config (SSH can’t traverse the proxy); add a:80reverse-proxy to the dashboard for*.incusaccess; single personal write-PAT scoped by path whitelist (the proxy matches secrets by host/path only — no env/header/per-agent gating is possible, so path-scoping a single PAT is the workable model; most-specific pathPattern wins). - Caveat: postgres isn’t persisted, so a recreate still resets seeded secrets + agent token (re-run the reseed). Persisting postgres too would make recreates seamless.
Todo
- (Reference only) Evaluate whether the “re-append CA inside the ingress generator” lesson applies to
incus-ingress.nixhere — currentlyinit-ingress-caresets the bundle on boot andincus-pull-care-appends manually
Configure jjui theme for readability with Pencil Dark terminal theme (flakes-p7hc)
Add settings.ui.colors overrides to programs.jjui in modules/home/programs/jujutsu.nix to fix readability issues with the Pencil Dark (Gogh) WezTerm color scheme. The default dark theme uses ‘bright black’ for dimmed text and selected backgrounds, which is too dark/invisible in Pencil Dark.
Summary of Changes
Added settings.ui.colors overrides to programs.jjui block in modules/home/programs/jujutsu.nix. Key fixes:
dimmed:"bright black"→"#808080"(mid-gray, readable in Pencil Dark)selected/revisions details selectedbg:"bright black"→"#3a3a3a"revset completionbg:"black"→"#1a1a1a"revset completion dimmed: same fix asdimmed
Config verified at ~/.config/jjui/config.toml after just activate-home.
Unify incus container image build tasks (flakes-p8hf)
Replace per-container build-image/build-metadata/build-and-import tasks with a single parameterized task that builds image+metadata and imports directly without staging in images/
Summary of Changes
Replaced 9 per-container tasks (build-yolo-image, build-yolo-metadata, build-and-import-yolo, and equivalents for spacebot/hermes) with a single mise run build-container <name> task.
- Uses
usagefield with KDLchoicesfor shell auto-complete (covers all 5 containers) - Builds metadata + image sequentially, resolves nix store paths directly from
resultsymlink - Pipes both tarballs straight to
incus image import— noimages/staging directory needed - Removed
images/directory entirely
Add Cloudflare MCP server to Claude settings (flakes-pbel)
Cloudflare has an official hosted MCP server (Streamable HTTP, OAuth) at https://mcp.cloudflare.com/mcp covering Workers, R2, KV, D1, DNS, Workers AI and the rest of the platform. Add it declaratively next to the victoriametrics/victorialogs entries in mcpServers in packs/home/common/programs/claude/settings.nix:
cloudflare = {
type = "http";
url = "https://mcp.cloudflare.com/mcp";
};
Notes:
- Auth is OAuth through a browser on first connect. Fine on physical hosts; on headless containers it may need the existing mcp-oauth-bridge (packs/nixos/container/mcp-oauth-bridge.nix) or browser-login forwarding.
- Check whether Cloudflare’s per-product servers (docs, observability, bindings, …) are still offered and worth adding alongside the unified endpoint.
Todo
- Decide: unified endpoint only, or also per-product servers (unified only for now)
- Decide: all hosts/containers, or physical hosts only (OAuth constraint) — all (packs/home/common); containers sign in via the OAuth bridge + ssh forward (flakes-q3l5)
- Add entry to mcpServers in packs/home/common/programs/claude/settings.nix
- Activate home (mise run _activate-home) and complete the OAuth sign-in
- Verify the tools show up in a Claude Code session
Summary of Changes
Added cloudflare (https://mcp.cloudflare.com/mcp, HTTP) to programs.claude-code.mcpServers in packs/home/common/programs/claude/settings.nix, so every profile gets it. Signed in from yolo on 2026-10-22 via the x1 (ssh -L 3118:10.100.0.100:3118 to pc, then the OAuth bridge); claude mcp list shows it connected.
Setup OpenCode and Claude for spacebot container (flakes-pr3i)
Configure OpenCode with the claude-code-plugin (github:unixfox/opencode-claude-code-plugin) in the spacebot incus container, enabling Claude as a coding assistant within spacebot’s environment.
Summary of Changes
- Added
opencode-claude-code-pluginflake input (github:unixfox/opencode-claude-code-plugin, flake=false) - Updated
mixins/home/containers/spacebot.nix:- Added
llm-agents.opencodeandllm-agents.claude-codeto packages - Added
xdg.configFile."opencode/plugins/claude-code"pointing to plugin source
- Added
- Plugin placed at
~/.config/opencode/plugins/claude-codefor OpenCode to load - Also fixed minor bug in spacebot-restart (was calling spacebot-restart instead of spacebot-status)
Remove rtk setup (flakes-pzk7)
Remove rtk entirely: package, init script, Claude Code PreToolUse rewrite hook and its settings.json entry.
- Drop llm-agents.rtk from packs/home/common/ai/llm-agents.nix
- Delete packs/home/common/ai/init/rtk-init.bash
- Delete packs/home/common/programs/claude/hooks/rtk-rewrite.sh and the hook entry in files/settings.json
- Build check
Summary of Changes
Removed llm-agents.rtk, rtk-init.bash, the whole programs/claude/hooks/ dir (it existed only to link rtk-rewrite.sh), and the PreToolUse hook from files/settings.json. Applied on edger (home) and yolo (system switch); also deleted leftover ~/.local/share/rtk state on both.
WSL: callback forward + wslview auto-open (flakes-q3l5)
WSL/Windows (Case 2) side of flakes-mqe9. Chain: Windows → WSL (Ubuntu, home-manager-managed) → ssh host → incus exec → container. Fully declarative because WSL is managed by this repo; wslview (wslu) / cmd.exe /c start opens the Windows default browser from WSL.
Callback (needed for Phase A too)
-
programs.ssh.matchBlocks.mcp-oauth-pc(Host pc pc.* desktop desktop.* 172.22.1.9,LocalForward 3118 10.100.0.100:3118) inpacks/home/host/common/mcp-oauth-forward.nix— host profiles only (in containers CC itself listens on 3118). Windowslocalhost:3118/callback→ WSL localhost forwarding → WSL ssh -L → pc → yolomcp-oauth-bridge(socat eth0:3118 → 127.0.0.1:3118) → CC. - Verified: generated ssh config for
yjparkhas the LocalForward,yj@yolodoes not; in yolo,curl 10.100.0.100:3118/callback?...reaches a stand-in127.0.0.1:3118listener through the bridge. - (2026-10-22: Cloudflare sign-in from the x1 worked end to end with a manual
ssh -L 3118:10.100.0.100:3118; still to see with the managed config once flakes-tnjz is done) Activate home in WSL, then do a real MCP OAuth from yolo (e.g. Cloudflare, flakes-pbel) via Windows → WSL → ssh pc → incus yolo, one click on the printed link. (Confirms WSL2 localhost forwarding of the 127.0.0.1-bound ssh -L, and that the ssh host alias used from WSL matches the Host patterns.) - Direct Windows OpenSSH (unmanaged): add the same block to
%USERPROFILE%\.ssh\configby hand:Host pc pc.* desktop desktop.* 172.22.1.9 LocalForward 3118 10.100.0.100:3118
Phase B — zero-click auto-open (deferred: one click on the OSC link is fine, per user 2026-10-22)
- WSL open-listener that runs
wslview <url>(ensurewsluinstalled in the WSL home profile). - WSL ssh
RemoteForward 10.100.0.1:OPEN localhost:OPEN(bind host bridge IP) so container→gateway:OPEN→tunnel→WSL listener→wslview. - Host sshd
GatewayPorts clientspecified(the one non-flake host tweak) so the -R can bind the bridge IP. - Attach wrapper detects
SSH_CONNECTIONand injectsBROWSER_ROUTEaccordingly; OSC (Phase A) stays the fallback.
Package beans-serve (web UI) from source via nix (flakes-qe0o)
The nix package added in flakes-6ne0 installs the prebuilt beans release binary (CLI + beans tui). The public release does not publish beans-serve (the web UI / GraphQL server, ~59MB because it embeds the SvelteKit frontend), so the bw = beans-serve fish abbr still relies on the imperative ~/.local/bin/beans-serve.
To package beans-serve declaratively requires building from source (github.com/hmans/beans), which is a two-stage build:
- Frontend:
frontend/is SvelteKit + pnpm.pnpm install+pnpm build, output copied intointernal/web/dist/(consumed by//go:embed dist/*ininternal/web/embed.go). Needs apnpmDepsfixed-output hash. - Backend:
go build ./cmd/beans-serve(and optionally./cmd/beans,./cmd/beans-tui) viabuildGoModulewith avendorHash. Noteinternal/graph/generated.goappears committed, butmise.toml’s build runsgo generate ./...(gqlgen) first — confirm whether codegen is needed or the committed output suffices.
Open questions
- Is the web UI (
beans-serve) actually still used, or has the workflow moved to TUI / external beans server? If unused, scrap this. - Prefer building all three from source (replacing the prebuilt-binary package in flakes-6ne0 for consistency) vs. keeping prebuilt
beans+ source-builtbeans-serve?
Tasks (if pursued)
- Frontend derivation (pnpm) -> dist
- buildGoModule with vendorHash, embedding the built frontend
- Wire into home.packages; update
bw/btabbrs as needed; drop imperative~/.local/bin/beans*
Integrate Home Manager as a NixOS module (flakes-rg27)
Create modules/nixos/settings/home-manager.nix to import home-manager as a NixOS module so nixos-rebuild switch handles both system and home config in one command.
Summary of Changes
Created modules/nixos/settings/home-manager.nix which:
- Imports
home-manager.nixosModules.home-manager - Sets
useGlobalPkgs = trueanduseUserPackages = true - Passes
extraSpecialArgswith theflakeargument so home modules get their expected{flake, ...}argument - Wires
home-manager.users.yjparkto importconfigurations/home/yjpark.nixplus any host-specific mixin frommixins/home/hosts/<hostname>.nix
The module is auto-included in all NixOS hosts via the autowired modules/nixos/settings/ directory. Verified with nix flake check and just build-host — home-manager generation is now built as part of the NixOS system build.
Migrate from just to mise for task running (flakes-rg2j)
Add mise.toml files and shell abbreviations to migrate task running from just to mise. Keep justfiles intact during transition.
Summary of Changes
- Created at repo root with all 12 tasks from the main justfile
- Created with task
- Created with 4 preset tasks (update-presets + 3 individual)
- Added and abbreviations to fish () and nushell ()
- Justified files remain intact for the transition period
- All tasks verified working via
mise tasksandmise run vcs-status
Trial MCPVault as an MCP server for the notes vault (flakes-rv2o)
Optional follow-up from flakes-k3pr evaluation. MCPVault (bitbonsai/mcpvault) is an npm MCP server exposing a markdown vault to AI agents (read/write/patch/search/frontmatter/tags). It complements markdown-oxide (editor LSP) rather than replacing it. If wanted, register it as an MCP server: npx @bitbonsai/mcpvault@latest <vault-path>, pointed at the notes vault. Decide the vault path and which agent client(s) to wire it into. Skip if agent note-access isn’t needed.
Full jjui theme with terminal-independent hex colors (flakes-sk2r)
Replace the partial Pencil Dark fix with a complete theme using only hex/ANSI256 colors (no ANSI 0-15) so it looks good on any dark terminal.
Summary of Changes
Replaced partial Pencil Dark fix with a complete One Dark-inspired theme in modules/home/programs/jujutsu.nix. Covers all 60+ color keys: core, flash, confirmation, help, revisions list/details, revset/completion, status, menu, picker, oplog, evolog, rebase/squash/duplicate/revert/set_parents, input, choose. All colors use explicit hex values — no ANSI 0-15 — so the theme is terminal-agnostic.
Containerize OneCLI (flakes-t9u2)
Move OneCLI + postgres from podman-on-host to a dedicated incus container at 10.100.0.2. Update seeder to target container IP. Convert to NixOS service with local postgres (no more podman-in-podman).
Summary of Changes
- Created
nixos/containers/onecli/with NixOS config:- Static IP 10.100.0.2, native postgresql, podman onecli image with –network=host
- Selective imports (skips ingress.nix and onecli-proxy.nix)
- Registered “onecli” in
flake/nixos-configs.nix - Updated
mixins/nixos/services/onecli.nix: removed podman setup, now just the seeder pointing to 10.100.0.2 - Updated
packs/nixos/container/onecli-proxy.nix: reference 10.100.0.2 - Updated all launch/utility scripts: spacebot .102→.101, hermes .103→.102, ubuntu .101→.200, onecli scripts 10.100.0.1→10.100.0.2
- Rewrote
onecli-reset-db.bashto use incus exec instead of podman - Added
incus-launch-onecli.bash
Bootstrap home-manager on x1 WSL (Ubuntu) (flakes-tnjz)
First activation of the yjpark home profile on the Windows x1’s WSL Ubuntu, so the MCP OAuth callback forward (flakes-q3l5) and the rest of the CLI setup land there.
Prepared in the repo:
yjpark@wslhome config =home/yjpark-cli.nix(host packs, no GUI pack, so no niri/VSCode/claude-desktop builds);mise run _activate-home/nix runpicks it when$WSL_DISTRO_NAMEis set.flake.nixnixConfigadds the numtide cache (cache.numtide.com) for llm-agents; Nix only honours it for trusted users and asks once before using it.
Todo
- One-time root step on Ubuntu (not manageable by home-manager): trust the user so the flake’s cache is honoured. Upstream installer: append
trusted-users = root yjparkto/etc/nix/nix.conf; Determinate installer: put it in/etc/nix/nix.custom.conf. Thensudo systemctl restart nix-daemon. Make sureexperimental-features = nix-command flakesis on. - Confirm the WSL user is
yjpark(me.usernamesets home to /home/yjpark). - Clone the repo,
nix run(answer y to the cache prompts, or pass--accept-flake-config); check llm-agents packages are fetched, not built. - Continue with flakes-q3l5 end-to-end OAuth test.
Inhibit idle/sleep during audio/video playback (flakes-va02)
Add sway-audio-idle-inhibit to prevent hypridle from powering off monitors when audio is playing (e.g. YouTube, Netflix in Chrome). Changes: add package to hypridle.nix and spawn at niri startup.
Summary of Changes
- Added
sway-audio-idle-inhibitpackage tomixins/home/gui/linux/services/hypridle.nix - Added
spawn-at-startup "sway-audio-idle-inhibit"to niri config (config.common.kdl)
The daemon monitors PipeWire/PulseAudio for active audio streams and sends a Wayland idle inhibit signal, preventing hypridle from powering off monitors during video/audio playback.
Dynamic per-host Home Manager configs via flake module (flakes-vaiq)
Create home-hosts.nix flake module to auto-generate homeConfigurations for all NixOS hosts, with optional host mixins. Delete per-host config files.
Summary of Changes
- Created
modules/flake/home-hosts.nix: dynamically generates homeConfigurations for all NixOS hosts by readingconfigurations/nixos/dirs, with optional per-host mixins frommixins/home/hosts/<host>.nix - Created
mixins/home/hosts/gpd-p2.nix: imports incus/edger mixin only for gpd-p2 - Updated
modules/flake/activate-home.nix: adds fallback to plainyjparkconfig when hostname isn’t in known NixOS hosts - Deleted all per-host
configurations/home/yjpark@<host>.nixfiles (pc, edger, alienware-13, hp-g1, gpd-p2) - Key fix: used
lib.mkForceon wholelegacyPackagesattrset (not just homeConfigurations sub-key) to override autoWire’s perSystem definition
Phase A: container browser-open script (OSC) (flakes-vzo1)
Phase A of flakes-mqe9 — the universal, detection-free browser-open path.
Set the container’s $BROWSER (and an xdg-open shim, since Claude Code / tools may call xdg-open directly rather than honoring $BROWSER) to a script that writes the authorize URL to the human’s controlling TTY (/dev/tty, falling back to stderr — NOT stdout, which CC may capture) as:
- OSC 52 — copy URL to the system clipboard (rides back through zellij/SSH to the terminal).
- OSC 8 — clickable hyperlink.
- plain-text URL + bell.
Because these are terminal escape sequences on the live PTY, they land on whichever terminal the human is at (host desktop or Windows Terminal via WSL/SSH) with no case detection, and follow zellij detach/reattach. One click to open. This is the baseline that makes both access patterns work immediately.
Tasks
-
browser-openscript (writeShellApplication): URL from $1 (stdin fallback dropped — could block); OSC 52 + OSC 8 + plain + bell to /dev/tty (fallback stderr), single redirection - Wired
environment.variables.BROWSER→ script inmcp-oauth-bridge.nix -
xdg-openshim (lib.hiPriowriteShellScriptBin) → browser-open, in systemPackages - Verified: nix-build; OSC 52 base64 round-trips to URL + OSC 8 URI + bell (od-level); no-arg/empty-stdin exit 1 no hang; full yolo toplevel evaluates (no collision); reviewed
Summary of Changes
Phase A of the browser-open bridge — universal, detection-free.
Files
packs/nixos/container/mcp-scripts/browser-open.bash(new): writes the authorize URL to the human’s controlling TTY (/dev/tty, else/dev/stderr— never stdout, which CC captures) as OSC 52 clipboard + OSC 8 hyperlink + plain text + bell, in a single redirection. URL from$1only.packs/nixos/container/mcp-oauth-bridge.nix: builds it viawriteShellApplication, setsenvironment.variables.BROWSER, and installs anxdg-openshim (lib.hiPrio) so tools that call xdg-open directly are also caught.
Verified: nix-build; OSC 52 base64 round-trips to the URL, OSC 8 URI correct, bell present (byte-level); no-arg and empty-stdin exit 1 without hanging; bash -n; full yolo toplevel evaluates (hiPrio resolves any xdg-utils collision). Review subagent confirmed escape-sequence spec-correctness, ST bytes, set -e safety of the sink probe, and URL quoting.
Runtime caveat (documented): OSC 52 clipboard and OSC 8 hyperlink passthrough are best-effort under zellij (version/clipboard-config dependent). The script degrades gracefully — the printed plain-text URL is the guaranteed path. No code change needed.
Note: Phase A makes the URL visible/clickable everywhere but is not zero-click and does not itself deliver the OAuth callback — the callback forwards (host socat / WSL LocalForward) live in flakes-ok62 / flakes-q3l5, and zero-click auto-open is Phase B there.
pc: move /home to dedicated ext4 disk (nvme0n1) (flakes-wabt)
Wipe the SanDisk 1.8T NVMe (nvme0n1, formerly Windows/NTFS mounted manually at /data/win), format the whole disk as one ext4 partition, copy the current /home over, and declare fileSystems.“/home” in nixos/hosts/pc/hardware-configuration.nix.
- Unmount /data/win, wipe nvme0n1, single GPT partition, mkfs.ext4 -L home
- Initial rsync of /home to new fs
- Declare fileSystems.“/home” in pc hardware-configuration.nix, build
- Final rsync from TTY with user logged out, nixos-rebuild boot, reboot
- Verify, then reclaim old /home space on root fs
Summary of Changes
- Wiped the SanDisk 1.8T NVMe (old Windows/NTFS), one GPT partition, ext4 label
home, UUID 7f0e17fa-9aa1-4124-ae43-0de24e743822. - Added
fileSystems."/home"(by-uuid) tonixos/hosts/pc/hardware-configuration.nix. - Copied /home over, rebooted onto it, deleted the shadowed old /home on the root fs (~52G freed).
- Note: NVMe kernel names swapped after reboot (root is now nvme0n1p2, home nvme1n1p1); config uses UUIDs so this is harmless.
Remove k3s from g1 (offline during flakes-itu2) (flakes-x7wb)
g1 was offline when k3s was removed (flakes-itu2). Its config already has k3s and containerd disabled; it needs a switch plus the one-off runtime teardown that a13/p2 needed.
g1 imports mixins/nixos/zfs, so like a13/p2 it ran a standalone containerd on the ZFS snapshotter (dataset rpool/state/containerd, if it exists). k3s-killall.sh does not touch that containerd’s pod shims, hence the manual teardown.
Steps
- Build on pc and diff against g1’s running system (
nix store diff-closures); stop if anything other than k3s/containerd/kube tooling removals appears. - Check
systemctl is-active mihomoon g1 and that nix-daemon’s proxy is127.0.0.1:21102— the k3s clash goes away with this. sudo $(dirname $(readlink -f $(command -v k3s)))/k3s-killall.shbefore switching (while k3s is still on PATH).nix copy --to ssh://g1.yjpark.zerotier <toplevel>, thennix-env -p /nix/var/nix/profiles/system --set+switch-to-configuration switch.- Run the teardown script below, verify no failed units.
Teardown script (as used on a13 and p2)
set -u
# 1. Kill every pod process via the cgroup, then the shims.
[ -e /sys/fs/cgroup/kubepods/cgroup.kill ] && echo 1 | sudo tee /sys/fs/cgroup/kubepods/cgroup.kill >/dev/null
sudo pkill -f 'containerd-shim-runc-v2 -namespace k8s.io'
for i in $(seq 1 20); do pgrep -f 'containerd-shim-runc-v2 -namespace k8s.io' >/dev/null || break; sleep 1; done
echo "shims left: $(pgrep -cf 'containerd-shim-runc-v2 -namespace k8s.io')"
# 2. Unmount everything containerd/kubelet left, deepest first.
mount | awk '{print $3}' | grep -E '^/run/containerd|^/var/lib/containerd|^/var/lib/kubelet|^/run/k3s' | sort -r | while read -r m; do sudo umount -l "$m" 2>/dev/null || true; done
echo "mounts left: $(mount | grep -cE '/run/containerd|/var/lib/containerd|/var/lib/kubelet|/run/k3s')"
# 3. Remove the empty pod cgroup tree, bottom-up.
[ -d /sys/fs/cgroup/kubepods ] && sudo find /sys/fs/cgroup/kubepods -depth -type d -exec rmdir {} \; 2>/dev/null
echo "kubepods cgroup: $([ -d /sys/fs/cgroup/kubepods ] && echo present || echo gone)"
# 4. Destroy containerd's ZFS snapshotter dataset.
if zfs list -H rpool/state/containerd >/dev/null 2>&1; then sudo zfs destroy -r rpool/state/containerd && echo "zfs rpool/state/containerd destroyed"; fi
# 5. State directories.
sudo rm -rf /var/lib/containerd /run/containerd /var/lib/rancher /etc/rancher /var/lib/kubelet /run/k3s /run/flannel
rm -rf ~/.kube
for d in /var/lib/containerd /run/containerd /var/lib/rancher /etc/rancher /var/lib/kubelet ~/.kube; do [ -e "$d" ] && echo "STILL PRESENT: $d"; done
echo "failed units: $(systemctl --failed --no-legend | wc -l) mihomo: $(systemctl is-active mihomo)"
zfs list -H -o name -d1 rpool/state
Todo
- Diff, deploy and tear down on g1
Container-to-host network isolation (flakes-x821)
Add nftables INPUT rules on incusbr0 to block container→host traffic except DHCP (67/68) and DNS (53/5354). Container↔container traffic via FORWARD chain stays unrestricted.
Summary of Changes
- Updated
packs/nixos/host/incus.nix: removedtarget = "ACCEPT"from incus firewalld zone - Added explicit services: “dhcp” (UDP 67) and “dns” (TCP/UDP 53) for container→host DHCP/DNS
- Added ports 5354 TCP/UDP for custom dnsmasq DNS
- Container↔container traffic via FORWARD chain is unaffected (bridge forwarding)
Add rtk-rewrite.sh hook to claude module with home-manager linking (flakes-y887)
Add the rtk-rewrite.sh hook file to modules/home/programs/claude/hooks/ and set up home.file linking to ~/.claude/hooks/rtk-rewrite.sh
Summary of Changes
- Created
modules/home/programs/claude/hooks/rtk-rewrite.sh(copied from~/.claude/hooks/rtk-rewrite.sh) - Created
modules/home/programs/claude/hooks/default.nixlinking it to~/.claude/hooks/rtk-rewrite.shwith executable=true - Autowire in
claude/default.nixpicks up the new hooks/ subdirectory automatically — no other files changed
Replace CopyQ with cliphist (Wayland-native clipboard manager) (flakes-yyox)
Replace CopyQ (XWayland) with cliphist for Wayland-native clipboard history. Adds fuzzel picker keybinding, television cable channel, and fish function.
Summary of Changes
- Deleted
mixins/home/gui/linux/services/copyq.nix(removed CopyQ with forceXWayland) - Created
mixins/home/gui/linux/services/cliphist.nix(enables cliphist service) - Added
Mod+Vkeybinding in niri config to open fuzzel clipboard history picker - Added
xdg.configFilefor television cable channel inmodules/home/programs/television.nix - Created
modules/home/programs/fish/functions/clip.fishfor tv-based clipboard selection - Added
tcabbreviation inmodules/home/programs/fish/abbrs.nix
Add mdbook-beans tasks section to docs (flakes-zvh8)
Integrate mdbook-beans preprocessor into the flakes documentation, mirroring the litmus project setup. Adds kanban and all-tasks pages.
Summary of Changes
- Added
mdbook-beansflake input toflake.nix - Updated
docs/book.tomlwith beans preprocessor config and sidebar CSS - Created
docs/src/beans/tasks.md(all tasks) anddocs/src/beans/kanban.md(active tasks) - Copied
docs/src/beans-sidebar.cssfrom litmus for bean styling - Updated
docs/src/SUMMARY.mdwith Kanban and All Tasks links - Updated
modules/flake/docs.nixto include mdbook-beans and .beans data in build - Updated
mise.tomldocs tasks to use nix (ensuring mdbook-beans is available)
Bugs
- Fix llm-agents binary cache not being applied; drop dead ai trail (flakes-162n) — Done
- Fix Ctrl+Shift+C in wezterm clobbering zellij clipboard (flakes-5oyz) — Done ·
archived - Container switches revert on reboot (lxc-container module missing) (flakes-dnjc) — Done
- Auto-restart firewalld when zone config changes (flakes-ja9k) — Done
- Fix mise.toml var args bug (flakes-m3r8) — Done ·
archived - Fix git push auth inside Incus container via OneCLI proxy (flakes-nz9y) — Done ·
archived - Pass currentSystem to NixOS-integrated home-manager extraSpecialArgs (flakes-sytx) — Done
- nix-daemon: route cache.nixos.org through proxy (flakes-wsls) — In Progress
Fix llm-agents binary cache not being applied; drop dead ai trail (flakes-162n)
cache.numtide.com was whitelisted via extra-trusted-substituters but never added to substituters, so all llm-agents packages built from source. Also mixins/home/trails/ai.nix was never imported.
Summary of Changes
Root cause. github:numtide/llm-agents.nix does declare a binary cache in its
nixConfig (extra-substituters = [ "https://cache.numtide.com" ]), and that cache is
fully populated — all 7 referenced packages return HTTP 200 for their narinfo. But Nix
ignores a flake’s nixConfig unless the setting is whitelisted or accept-flake-config
is on, so every command printed:
warning: ignoring untrusted flake configuration setting 'extra-substituters'
packs/nixos/common/settings/nix/llm-agents.nix used extra-trusted-substituters, which
only permits a client to opt in to that substituter; it never joins the real
substituters list. nix show-config confirmed cache.numtide.com was absent from
substituters, so llm-agents packages were built from source.
Measured cost on codex + ck + beads:
- before: 11 derivations built (Rust codex, Go toolchain, dolt, ck pulling onnxruntime + openvino)
- after: 0 built, 1.1 GiB fetched
Changes.
packs/nixos/common/settings/nix/llm-agents.nix:nix.settings.extra-trusted-substituters->nix.settings.extra-substituters. Theextra-trusted-public-keysline was already correct and is unchanged.- Deleted
mixins/home/trails/ai.nix(and with it the now-emptymixins/home/trails/). Nothing imported it — mixins are only reachable by explicit import, and the auto-discovery inflake/home-configs.nixandflake/activate-home.nixonly scansmixins/home/hostsandmixins/home/containers. It held the only references tock,beads, and a pinneddoltoverride, which is why llm-agents felt mostly unused.
Verification.
nix fmtreported the file already correctly formatted.- Generated nix.conf for host
pcnow containsextra-substituters = https://cache.numtide.com, withsubstituterskeeping the CN mirror ordering frommixins/nixos/lan/cn/mirrors.nix(tuna, then cache.nixos.org, then numtide appended). - Dry-run against the live package set with the post-switch substituter list: nothing to build.
Still live from llm-agents (so the input is still needed): claude-code (also
programs.claude-code.package), agent-browser, rtk, opencode, codex via the
autowired packs/home/common/ai/llm-agents.nix; plus opencode and claude-code in
mixins/home/containers/spacebot.nix.
Notes.
- This is a system-level setting, so it needs
mise run _switch-hostper machine to take effect. - The “ignoring untrusted flake configuration setting” warning will still appear. It is now harmless and redundant: the cache comes from our own nix.conf rather than the flake’s nixConfig.
trusted-substitutersis now empty where it previously listed cache.numtide.com. Not a regression — opting in is unnecessary once it is a default substituter.
Fix Ctrl+Shift+C in wezterm clobbering zellij clipboard (flakes-5oyz)
Copy (to system clipboard) doesn’t work when using wezterm → incus shell → zellij. Root cause: Ctrl+Shift+C runs CopyTo(‘Clipboard’) which copies empty terminal selection, overwriting what zellij put in clipboard via OSC 52. Fix: only copy when there’s an actual selection.
Summary of Changes
Changed binding in from a direct action to a callback that first checks if there’s an actual terminal selection. Only copies when selection is non-empty, matching kitty’s behavior and preventing the clipboard from being clobbered when zellij has already set it via OSC 52.
Container switches revert on reboot (lxc-container module missing) (flakes-dnjc)
nixosConfigurations.
- Import lxc-container.nix from packs/nixos/container
- Redeploy onecli and yolo with the lxc-capable toplevel
- Verify /sbin/init points at the new system and survives incus restart
Summary of Changes
packs/nixos/container/configuration.nix now imports modulesPath + /virtualisation/lxc-container.nix, so every container toplevel is the -lxc variant and its installBootLoader repoints /sbin/init on switch. build-image --image-variant lxc still evaluates (same module path, deduplicated). Redeployed onecli and yolo; incus restart onecli came back on the new system. yolo was switched but not restarted (its /sbin/init points at the new system).
Auto-restart firewalld when zone config changes (flakes-ja9k)
NixOS services.firewalld module doesn’t restart/reload the firewalld service when zone config changes, so switch-host applies new XML but the running daemon keeps old rules until manually restarted.
Context
Discovered while debugging ICMP/ping access (commits 84638b0, 235381f). After running mise run _switch-host with new services.firewalld.zones.lan settings (added protocols = ["icmp"] and extra source range), the active runtime config from firewall-cmd --zone=lan --list-all still showed the old rules. Manual sudo systemctl restart firewalld was required.
Investigation
- Confirm root cause: nixpkgs
services.firewalldsets norestartTriggers/reloadTriggers; zone/service XML lands in/etc/firewalld/{zones,services}/*.xmlviaenvironment.etc, disconnected from the unit - Decided reload: the unit already has
ExecReload = kill -HUP $MAINPID; firewalld reloads permanent config on SIGHUP, non-disruptive - (deferred) Check if upstream nixpkgs already has an open issue/PR — no web research done this shift
Implementation
- Added
systemd.services.firewalld.reloadTriggersinpacks/nixos/common/settings/firewalld.nixreferencing everyfirewalld/*etc source (zones, services, policies, firewalld.conf) - Verified at eval/build:
reloadTriggersresolves to the exact content-addressed zone/service XML store paths (incl.zone-lan.xmlon a13); reviewer confirmed realizedX-Reload-Triggerscontent. NOTE: live_switch-host+firewall-cmdtest still pending on a physical host (cannot run from the yolo container) - (follow-up) Consider upstreaming the
reloadTriggersfix to nixpkgs
Plan
Root cause confirmed by reading the nixpkgs services.firewalld module (services/networking/firewalld/{default,zone,service}.nix):
- Zone XML →
/etc/firewalld/zones/<name>.xml, service XML →/etc/firewalld/services/<name>.xml(viaenvironment.etc). - The systemd unit sets
ExecReload = kill -HUP \$MAINPID(firewalld reloads permanent config on SIGHUP) but has noreloadTriggers/restartTriggers. So when only the etc XML changes, the unit definition is unchanged andswitch-hostnever reloads the daemon → stale runtime rules.
Fix (reload, not restart — non-disruptive)
In packs/nixos/common/settings/firewalld.nix, set systemd.services.firewalld.reloadTriggers to the .source of every generated firewalld/* etc entry. Any zone/service XML change then flips the trigger and switch-to-configuration issues systemctl reload firewalld → SIGHUP → reload.
No upstream change attempted in this pass (note as possible follow-up).
Summary of Changes
File: packs/nixos/common/settings/firewalld.nix
Added systemd.services.firewalld.reloadTriggers, computed from every config.environment.etc entry whose key starts with firewalld/ (mapped to its .source). This covers firewalld.conf, zones/*.xml, services/*.xml, and policies/*.xml.
Why it works: the nixpkgs module writes firewalld permanent config to /etc/firewalld/... but never linked those files to the systemd unit, so switch-host left the daemon running stale rules. Wiring the etc sources into reloadTriggers makes switch-to-configuration issue systemctl reload firewalld whenever any firewalld config file content changes; the unit ExecReload sends SIGHUP and firewalld reloads its permanent config into runtime (non-disruptive).
Decision: chose reload (SIGHUP) over restart — matches the bean preference, no connection flush. sysconfig/firewalld (FIREWALLD_ARGS, needs a restart) is intentionally excluded; extraArgs is empty and rarely changes.
Verification: nix eval/nix build confirm reloadTriggers resolves to the exact content-addressed XML store paths; a review subagent independently built the yolo config and confirmed the realized X-Reload-Triggers content. Live _switch-host + firewall-cmd --list-all test is deferred to a physical host (not runnable from a container).
Follow-ups: check for / open an upstream nixpkgs issue or PR.
Fix mise.toml var args bug (flakes-m3r8)
Remove unused args and fix the var=true arg to be optional (default=‘’) in mise.toml
Summary of Changes
- : removed unused — task never needed extra args
- : changed to so it’s optional
- : removed unused trailing
- : removed unused trailing
Fix git push auth inside Incus container via OneCLI proxy (flakes-nz9y)
git push inside the container failed with ‘could not read Username for https://github.com: terminal prompts disabled’. Two root causes were identified and fixed.
Summary of Changes
Problem
git push inside the Incus container failed with:
fatal: could not read Username for 'https://github.com': terminal prompts disabled
The OneCLI MITM proxy was correctly configured and the proxy was being used, but two issues prevented authentication from working.
Root Cause 1: gh credential helper override
Home Manager’s programs.gh module auto-registers gh auth git-credential as a git credential helper for github.com. The lib.mkForce "" in git.nix cleared the helper list, but gh re-added its helper after the clear. Git would call gh auth git-credential, which tried the placeholder GH_TOKEN=onecli-managed, failed, then fell back to terminal prompt.
Fix: programs.gh.gitCredentialHelper.enable = false in mixins/home/container/git.nix
Root Cause 2: Wrong auth format for GitHub’s git HTTP endpoint
OneCLI was injecting Authorization: token <PAT> which works for GitHub’s REST API (api.github.com) but NOT for GitHub’s git smart HTTP endpoint (github.com). The git endpoint requires Basic auth: Authorization: Basic base64(x-access-token:<PAT>).
Fix: Added encoding = "basic-auth" field to GITHUB_TOKEN secret config in mixins/nixos/services/onecli.nix. The seeder script base64-encodes x-access-token:<value> when this encoding is set, and the valueFormat was changed to Basic {value}.
Key diagnostic commands
GIT_CURL_VERBOSE=1 git push— revealed git wasn’t sendingProxy-Authorization(fixed byhttp.proxyAuthMethod = basic)- OneCLI gateway logs (
podman logs onecli) — confirmed MITM + injection was happening but GitHub returned 401 - Certificate issuer in TLS handshake — confirmed OneCLI CA vs real cert (MITM vs tunnel)
Files modified
mixins/home/container/git.nix— disabled gh credential helper, removed extraHeader workaround, addedproxyAuthMethod = basicmixins/nixos/services/onecli.nix— changed GITHUB_TOKEN to Basic auth format with base64 encoding at seed time
Pass currentSystem to NixOS-integrated home-manager extraSpecialArgs (flakes-sytx)
nixos-rebuild on g1 fails with infinite recursion in packs/home/host because the NixOS-integrated home-manager module (packs/nixos/common/settings/home-manager.nix) doesn’t pass currentSystem via extraSpecialArgs. Standalone home configurations get it via flake/home-configs.nix but NixOS hosts that use home-manager.users.* don’t.
Summary of Changes
Updated packs/nixos/common/settings/home-manager.nix to:
- Take
pkgsas module argument - Pass
currentSystem = pkgs.stdenv.hostPlatform.systemviaextraSpecialArgs
This mirrors what flake/home-configs.nix already does for standalone home configurations. The integrated home-manager NixOS module evaluates packs/home/host (via home/yjpark.nix imported through packs/nixos/host/yjpark.nix), and that module reads currentSystem in its imports to conditionally include the linux subdirectory.
Verified: g1 evaluation now progresses past the recursion point (fails only on an unrelated network fetch of Smithay/smithay.git).
nix-daemon: route cache.nixos.org through proxy (flakes-wsls)
On edger, direct cache.nixos.org NAR fetch ~22KB/s vs ~338KB/s via clash; tuna mirror returns 403 so everything falls through to direct cache.nixos.org, making switch-host very slow. Remove cache.nixos.org from no_proxy in mixins/nixos/cn/proxy-env.nix.
Todo
- Remove cache.nixos.org from noProxy
- Drop tuna substituter (mixins/nixos/cn/mirrors.nix) and its no_proxy entry
- Switch host and verify faster substitution
Note: a stale imperative /run/systemd/system/nix-daemon.service.d/override.conf (10.0.4.13:1102) still exists on edger; remove it after switching.
Drafts
- lima->incus host-routable VM IP + self-healing route (macOS) (flakes-1huh) — Draft
- Configure & run ZeroClaw (config, secrets, service) (flakes-8itl) — Draft
- Expose kudo on pc via Cloudflare tunnel as kudo_pc.yjpark.org (flakes-d9tk) — Draft
- Ingress hub on p2, exposed as hub_p2.yjpark.org (flakes-gb22) — Draft
- Declarative incus fleet management (flakes-ihxf) — Draft
- Zellij WASM plugin for dynamic tab naming (flakes-je55) — Draft
- Setup quartz to preview and publish oxide projects (flakes-k391) — Draft
- MITM egress-proxy CLI: stable CA + ease-of-use (reference) (flakes-p2dp) — Draft
- Package beans-serve (web UI) from source via nix (flakes-qe0o) — Draft
- Trial MCPVault as an MCP server for the notes vault (flakes-rv2o) — Draft
- Reach pc ingress services without ZeroTier (flakes-xv5g) — Draft
lima->incus host-routable VM IP + self-healing route (macOS) (flakes-1huh)
Reaching incus containers (e.g. 10.100.0.0/24) directly from macOS, surviving reboots and VM IP changes.
Note on scope: the moving parts here are macOS-side — a lima VM template and launchd agents on the Mac host. This flakes repo manages NixOS/home-manager, not the macOS host or the lima template, so this is largely external. Captured as a reference/draft bean; the in-repo touchpoint is boot.autostart and container networking inside incus.
Design
- vzNAT network in the lima template gives the VM a host-routable IP (Mac
192.168.64.1, VM192.168.64.5); the container reaches the Mac via VM NAT. This is the substrate the MCP OAuth bridge rides on. - Self-healing route: a launchd agent runs an idempotent
ensure-route— it only touches the routing table when the route is missing or stale (no-op + no sudo when it already points at the VM’s current IP). A one-timeroute-allow-sudodrops a narrow sudoers line so the agent can maintain the route unattended. - VM auto-start via a launchd agent so containers survive Mac reboots (
boot.autostartinside, agent restores the route once the VM is up).
Todo
- (External) lima template with vzNAT network
- (External) launchd
ensure-routeagent + narrowroute-allow-sudosudoers line - (External) launchd VM auto-start agent
- (In-repo, if applicable) confirm
boot.autostartis set on incus containers that should survive reboots
Configure & run ZeroClaw (config, secrets, service) (flakes-8itl)
Follow-up from flakes-kj17, which installed the ZeroClaw binaries (v0.8.2) via nix (packs/home/common/packages/zeroclaw.nix). This bean covers actually running/configuring ZeroClaw, which needs user decisions and secrets and so was deferred from the autonomous install.
ZeroClaw is a self-hosted autonomous AI assistant runtime: LLM providers (Anthropic/OpenAI/Ollama/…), channels (Discord/Telegram/Matrix/email/CLI), tools (shell/browser/http), configured via ~/.zeroclaw/config.toml.
Decisions needed
- Which LLM provider(s) + API keys — manage secrets via sops-nix (this repo’s pattern), not plaintext config
- Which channels/integrations to enable, and the autonomy level (this thing can run shell/tools — scope carefully)
- Run mode: on-demand CLI (
zeroclaw/zerocode) vs. an always-on service. Upstream ships a NixOS module (system service), not a home-manager service — decide host(s) and whether to use the upstream module or a home-manager systemd user service - Which machines should run it (currently the binary is in the common home profile → all profiles incl. containers; consider narrowing to a host mixin)
Tasks (once decided)
- Declarative
config.toml(home-managerhome.fileor xdg) with secrets wired via sops-nix - If service: import upstream NixOS module on the chosen host, or define a user service
- Verify a minimal end-to-end run (one provider, CLI channel)
Notes
- The release tarball also ships a
web/dist/dashboard copy; the static binary likely embeds its UI. If the web dashboard fails to find assets at runtime, packageweb/dist/alongside and point ZeroClaw at it. - To track latest: bump
version+sha256inzeroclaw.nixfrom the releaseSHA256SUMS.
Expose kudo on pc via Cloudflare tunnel as kudo_pc.yjpark.org (flakes-d9tk)
Same pattern as flakes-2ab4 (hub_pc): Access app reusing the ssh_pc email policies (create first), proxied CNAME to pc’s tunnel 829deb72-9870-4b61-9120-bf748d85fbd2, and a tunnel rule before the 404 catch-all.
Wait until kudo and the hub are working end to end. Then pick the origin: the kudo hub (services.hub, bound to 10.100.0.1:15400 and 172.22.1.9:15400, see mixins/nixos/services/kudo-hub.nix) or a Caddy route, and check whether kudo needs websockets or non-browser clients. A non-browser client needs an Access service token or a bypass policy.
Ingress hub on p2, exposed as hub_p2.yjpark.org (flakes-gb22)
p2 has no hub yet: mixins/nixos/services/incus-ingress is only imported on pc and edger. Deferred on 2026-10-22.
What it takes
- Make
ingress.containersin the incus-ingress mixin overridable (it hardcodes onecli/searxng/yolo); p2 gets[]unless it runs containers - Import incus-ingress in nixos/hosts/p2/imports.nix; add p2 to
ingress.sites(packs/nixos/host/ingress.nix) - DNS:
*.p2.yjpark.orgA record → 172.22.1.5 (ZeroTier, unproxied), like pc/edger - Switch p2; check hub.p2.yjpark.org over ZeroTier
- Cloudflare, same as flakes-2ab4: Access app (ssh_* allow-email policies) first, proxied CNAME hub_p2 → p2’s tunnel, tunnel rule → http://localhost:80 with httpHostHeader hub.p2.yjpark.org
Notes
- The only hub service on p2 today is clash (
ingress.servicesevaluates to [“clash”]); incus is enabled. - The cloudflare-caddy secret (mixins/nixos/services/secrets/cloudflare-caddy.txt) is already encrypted for p2’s age key.
- p2 is a CN host: Caddy needs the clash proxy env for Let’s Encrypt (mixins/nixos/cn/proxy-env.nix already covers it).
Declarative incus fleet management (flakes-ihxf)
NixOS module to declare containers (image, IP, devices, ACLs) and have them rebuild/restart on _switch-host. Long-term goal.
Design notes (night-shift planning pass, 2026-06-30)
Not implemented this shift: building a declarative incus orchestration layer would mutate the live fleet (create/configure/restart containers) — unverifiable in CI and risky to run unattended, and it hinges on design decisions that are architect calls. Captured the design surface so it’s actionable later. Set to draft (needs design refinement before implementation), per the repo’s planning≠implementation rule.
Current state (what this would supersede / build on)
- Imperative launch/restart scripts:
packs/home/host/linux/scripts/incus/incus-launch-*.bash,incus-restart-*.bash,incus-setup-storage-ext4.bash— per-container shell, run by hand. - Host incus enablement:
packs/home/host/linux/incus.nix,packs/nixos/host/incus.nix,mixins/home/settings/incus/. - Static fleet list already exists in
mixins/nixos/services/incus-ingress.nixasingressContainers = [ { name; ip; } ... ](onecli .2, searxng .3, yolo .100, spacebot .101, hermes .102). A declarative fleet module should become the single source of truth feeding both container creation and this ingress list (DRY). - Containers are all NixOS containers (
nixos/containers/*); the Ubuntu container setup was dropped.
Key design decisions (need a call before implementation)
- Option schema: e.g.
services.incus.fleet.<name> = { image; ipv4; devices; profiles; acls; storageVolumes; autostart; ... }. - Reconciliation model: activation script / systemd oneshot on
_switch-hostthat diffs declared vsincus list --format jsonand creates/configures/restarts. Must be idempotent and non-destructive (never delete/recreate a container with data; the egress-proxy work showed CA/postgres data lives on custom storage volumes that must persist across recreate). - Image source: build NixOS container images from this flake (reproducible) vs. pull Ubuntu images vs. both. Affects how “image” is declared.
- Scope of management: devices (proxy/disk/gpu),
ipv4.addressoverrides (currently set by hand viaincus config device override), network ACLs, profiles, storage volumes. - Restart policy: what changes trigger a restart vs. a live
incus configapply; avoid disrupting running services unnecessarily. - Migration: supersede the imperative
incus-launch-*/incus-restart-*scripts, or coexist during transition.
Proposed phased decomposition (create as child beans once decisions above are made)
fleetoption schema only (pure types, no side effects) + deriveingressContainersfrom it.- Read-only reconciler: report drift between declared fleet and
incus list(no mutation) — safe to land + verify first. - Create/ensure containers from declarations (idempotent, non-destructive; storage volumes persist).
- Device / ACL / profile / IP-override management.
- Wire restart-on-change into
_switch-host; migrate the imperative scripts.
Zellij WASM plugin for dynamic tab naming (flakes-je55)
Background
We implemented project-aware tab naming in Zellij via fish shell hooks. After extensive iteration, the current approach uses zellij action dump-layout to parse pane names in visual order and compose tab names (e.g., flakes | litmus).
What works well (current fish implementation)
- Project detection via git root basename (
zellij_project_name) - Pane naming with
<project>prefix (zellij_update_panename) - Deterministic pane background colors per project (
zellij_update_pane_color) - Tab name composed from unique project names in visual order (
zellij_visual_projects) dump-layoutparsing gives correct visual order and avoids state file race conditions
Remaining trigger limitations (fish shell can’t solve)
- Pane moves between tabs: no fish event fires when a pane is moved — tab name only updates on next
cd - Pane detach/reattach: splitting a pane into a new tab doesn’t trigger any shell hook
- Non-shell panes: panes running editors, Claude, or other long-running processes never return to fish prompt
- All-tab updates: when a pane moves, both source and destination tabs need updating — fish can only rename the current tab
Why a WASM plugin is the right approach
- Zellij plugins receive native events:
TabUpdate,PaneUpdate,ModeUpdate - A plugin can react to pane moves, tab changes, and layout changes in real-time
- It can update ALL tab names (not just the focused tab) via
rename_tab - No shell hooks needed for tab naming — the plugin handles it entirely
- Fish hooks can focus solely on pane-level concerns (pane name, pane color)
Design considerations
- Research Zellij plugin API for tab/pane events
- Determine how to detect pane project (read pane name set by fish, or query cwd?)
- Prototype plugin that listens to layout changes and renames tabs
- Decide whether to keep fish-based pane naming or move everything to the plugin
- Package the plugin with Nix
Reference
- Zellij plugin docs: https://zellij.dev/documentation/plugins
- Current fish implementation:
modules/home/programs/fish/init/zellij.fish - Tab bar plugin already in use:
~/.config/zellij/plugins/tab-bar.wasm
Setup quartz to preview and publish oxide projects (flakes-k391)
Blocked — needs spec (triaged 2026-06-29, night shift)
The bean has no body and the approach can’t be determined without guessing on several independent axes. Context found: ‘oxide projects’ most likely refers to markdown-oxide notes (the Obsidian-style markdown PKM enabled in [[flakes-7ih3]] via the markdown_oxide LSP — but no vault path is configured anywhere in the repo).
Quartz (https://quartz.jzhao.xyz) is a static-site generator that publishes a folder of Obsidian/markdown notes. It’s structured as a per-content project scaffold (clone quartz, put markdown in content/, npx quartz build/preview), not a home-manager package — so this is a project/workflow setup, not a dotfiles config change.
Open questions blocking implementation
- Content source: which markdown directory/vault are the ‘oxide projects’? Where does it live (path / separate git repo / the private/ dir)?
- Repo location: should the Quartz project live in this flakes repo, a sibling repo, or inside the notes vault?
- Publish target: GitHub Pages? Cloudflare Pages? The existing host Caddy ingress (
*.${host}.yjpark.org, seemixins/nixos/services/incus-ingress.nix)? Cloudflared tunnel? This drives the whole ‘publish’ half. - Preview: local
npx quartz build --serveis generic; fine once content path is known.
Proposed approach (once unblocked)
- Scaffold Quartz pointing
content/at the vault (or symlink); add amise/just task forpreview; pick a publish target and add a build+deploy task (or a NixOS/cloudflared service if self-hosting). Optionally add thequartz/node toolchain to a dev shell.
Moved to draft so it leaves the ready queue until the content source + publish target are decided.
MITM egress-proxy CLI: stable CA + ease-of-use (reference) (flakes-p2dp)
Lessons from making a corporate egress-proxy CLI stable + easy to use. The tool MITMs all outbound HTTPS through a local proxy with its own CA. Patterns generalize to “any MITM-proxy-with-rotating-CA” setup.
Note on scope: this is a work-specific corporate tool that does not live in this flakes repo. Captured here as a reference bean for the lessons learned; the analogous in-repo pattern is the ingress CA bundle handling in mixins/nixos/services/incus-ingress.nix. Not directly implementable in this repo — treat as reference / draft.
Lessons
- CA must come from the real signing cert, not the management API. The proxy’s
/api/gateway/caendpoint can report a CA that does not match what it actually signs MITM certs with (regenerated-after-restart vs the persisted volume CA). Read the CA from the on-disk signing cert (.../gateway/ca.pem) instead. That one is stable (10-yr, survives restart/reboot; changes only on container recreate). - Persist the CA across recreate. Back the proxy’s data dir with a dedicated incus custom storage volume (bind-mounted), so CA + encryption key survive
delete+recreate. Verified: CA hash unchanged across a full recreate. - The ingress CA bundle gets clobbered — re-append on every rebuild. The dynamic ingress-config generator rebuilds the world-readable
ca-bundle.crtascat system + caddyon every port change, silently dropping the proxy CA that a separate service had appended. Net effect: TLS works right after boot, then breaks mid-session when a port change re-triggers ingress-sync. Fix: append the proxy CA inside the generator itself. (git/libcurl readsSSL_CERT_FILE/NIX_SSL_CERT_FILE-> the bundle, so once the CA is in the bundle, no per-commandhttp.sslCAInfoflag is needed.) - git push over the proxy: the proxy CA must be in the world-readable bundle; the root-only
ca.crt(mode 000) isn’t readable by the non-root user. - Ease-of-use wins: rewrite
git@host:...SSH URLs to HTTPS in container git config (SSH can’t traverse the proxy); add a:80reverse-proxy to the dashboard for*.incusaccess; single personal write-PAT scoped by path whitelist (the proxy matches secrets by host/path only — no env/header/per-agent gating is possible, so path-scoping a single PAT is the workable model; most-specific pathPattern wins). - Caveat: postgres isn’t persisted, so a recreate still resets seeded secrets + agent token (re-run the reseed). Persisting postgres too would make recreates seamless.
Todo
- (Reference only) Evaluate whether the “re-append CA inside the ingress generator” lesson applies to
incus-ingress.nixhere — currentlyinit-ingress-caresets the bundle on boot andincus-pull-care-appends manually
Package beans-serve (web UI) from source via nix (flakes-qe0o)
The nix package added in flakes-6ne0 installs the prebuilt beans release binary (CLI + beans tui). The public release does not publish beans-serve (the web UI / GraphQL server, ~59MB because it embeds the SvelteKit frontend), so the bw = beans-serve fish abbr still relies on the imperative ~/.local/bin/beans-serve.
To package beans-serve declaratively requires building from source (github.com/hmans/beans), which is a two-stage build:
- Frontend:
frontend/is SvelteKit + pnpm.pnpm install+pnpm build, output copied intointernal/web/dist/(consumed by//go:embed dist/*ininternal/web/embed.go). Needs apnpmDepsfixed-output hash. - Backend:
go build ./cmd/beans-serve(and optionally./cmd/beans,./cmd/beans-tui) viabuildGoModulewith avendorHash. Noteinternal/graph/generated.goappears committed, butmise.toml’s build runsgo generate ./...(gqlgen) first — confirm whether codegen is needed or the committed output suffices.
Open questions
- Is the web UI (
beans-serve) actually still used, or has the workflow moved to TUI / external beans server? If unused, scrap this. - Prefer building all three from source (replacing the prebuilt-binary package in flakes-6ne0 for consistency) vs. keeping prebuilt
beans+ source-builtbeans-serve?
Tasks (if pursued)
- Frontend derivation (pnpm) -> dist
- buildGoModule with vendorHash, embedding the built frontend
- Wire into home.packages; update
bw/btabbrs as needed; drop imperative~/.local/bin/beans*
Trial MCPVault as an MCP server for the notes vault (flakes-rv2o)
Optional follow-up from flakes-k3pr evaluation. MCPVault (bitbonsai/mcpvault) is an npm MCP server exposing a markdown vault to AI agents (read/write/patch/search/frontmatter/tags). It complements markdown-oxide (editor LSP) rather than replacing it. If wanted, register it as an MCP server: npx @bitbonsai/mcpvault@latest <vault-path>, pointed at the notes vault. Decide the vault path and which agent client(s) to wire it into. Skip if agent note-access isn’t needed.
Reach pc ingress services without ZeroTier (flakes-xv5g)
hub_pc.yjpark.org works off ZeroTier, but the links on the hub page (<svc>.pc.yjpark.org, <c>-<port>.pc.yjpark.org) resolve to pc’s ZeroTier IP 172.22.1.9 (the *.pc.yjpark.org A record isn’t proxied), so they don’t load from outside.
Constraints
- Universal SSL covers only
*.yjpark.org(one level). Proxying*.pc.yjpark.orgwould need Advanced Certificate Manager or Total TLS, and would take those names away from ZeroTier-direct use. - pc’s tunnel is remote-managed, so ingress rules live in Cloudflare, not in Nix.
- Container ports are found at runtime (hub API), so no fixed list exists for them.
Options
- Flat public names, e.g.
<svc>_pc.yjpark.org/<c>-<port>_pc.yjpark.org, covered by*.yjpark.org. One wildcard tunnel rule (or one per service) to Caddy on :80. Caddy also matches the_pcform and maps it to the same routes. The hub page picks public or ZeroTier URLs based on the hostname it was loaded from. Needs a wildcard DNS record or a record per name, and Access on each name (or one wildcard Access app). - Move the tunnel to locally-managed config (services.cloudflared ingress in Nix), with rules generated from ingress.services. Fully declarative, but static. Container ports would still need a wildcard (option 1).
- Path-based through the hub (
hub_pc.yjpark.org/s/<name>/): no DNS or certificates to set up, but breaks apps that expect to sit at the root path (this was dropped before in flakes-i4ol).
Leaning toward 1. Open question: is *.yjpark.org already used by anything else?