From 844337ca91fb43cc8db7e19b8147cd3c6a1045a1 Mon Sep 17 00:00:00 2001 From: iris Date: Sat, 15 Aug 2026 12:26:35 +0200 Subject: [PATCH] docs(gotchas): fix stale set_nspawn_flags path + SPA-fallback file/paths Verified against hive-c0re/src/lifecycle/host_config.rs (function lives in the host_config submodule, not bare lifecycle::) and nix/host-modules/hive-matrix.nix (the working Accept-header SPA fallback lives there, serving fluffychat at the vhost root /index.html, not a /matrix/ path prefix in a nonexistent hive-gateway.nix). --- docs/gotchas.md | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/docs/gotchas.md b/docs/gotchas.md index b5bf6782..a3b131c8 100644 --- a/docs/gotchas.md +++ b/docs/gotchas.md @@ -12,8 +12,8 @@ touching. The CLI doesn't accept `--bind`. Path is via `EXTRA_NSPAWN_FLAGS` in `/etc/nixos-containers/.conf` — the start script (`/nix/store/.../container_-start`) expands it unquoted into the -`systemd-nspawn` invocation. `lifecycle::set_nspawn_flags()` rewrites -this line. +`systemd-nspawn` invocation. `lifecycle::host_config::set_nspawn_flags()` +rewrites this line. ### `/run/systemd/nspawn/*.nspawn` overrides are ignored @@ -187,21 +187,22 @@ scripts, manual `rm -rf`), the dashboard's next render marks them ### SPA fallback: use `Accept` header map, not `try_files ... /index.html` -The naive nginx pattern for a path-prefix SPA (`try_files $uri $uri/ -/matrix/index.html`) silently swallows asset 404s — a missing JS file +The naive nginx pattern for an SPA (`try_files $uri $uri/ +/index.html`) silently swallows asset 404s — a missing JS file returns `index.html` with a 200, so the JS runtime never loads and the page renders blank with no visible error. Extension allowlists (tried as an alternative) have the same maintenance problem: any new file extension the SPA ships breaks silently. -The pattern that works (`hive-gateway.nix`) keys the fallback on the +The pattern that works (`nix/host-modules/hive-matrix.nix`, serving +fluffychat at the matrix gateway vhost's root) keys the fallback on the HTTP `Accept` header: ```nginx # Outside the server block (appendHttpConfig): map $http_accept $matrix_spa_target { default "/__matrix_spa_no_html_fallback"; - "~*text/html" "/matrix/index.html"; + "~*text/html" "/index.html"; } # Inside the location: