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).
This commit is contained in:
iris 2026-08-15 12:26:35 +02:00 committed by mara
commit 844337ca91

View file

@ -12,8 +12,8 @@ touching.
The CLI doesn't accept `--bind`. Path is via `EXTRA_NSPAWN_FLAGS` in
`/etc/nixos-containers/<NAME>.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: