hyperhive/nix/module-eval
Repository files (latest commit first)
Filename Latest commit message Latest commit date
atlas 2252c55df8 hive-priv: create agent socket dirs on start; drop hyperhive-agents.conf
/etc/tmpfiles.d/hyperhive-agents.conf was a boot-time backstop (#2290)
that pre-created every agent's bind sources. The start preamble already
creates them for every c0re-driven start, and on this host only hive-c0re
starts agent containers. The file was also the reason the socket dir's
owner had to be declared there, which is how it spent its life at
`0777 root root` whenever the uid could not be resolved (#4742).

- hive-priv gains `EnsureAgentSocketDir { name }`, called from
  `set_nspawn_flags` in every start path. It creates
  `/run/hive-agent/<name>` `0751 root:root` with mkdirat relative to an
  O_DIRECTORY|O_NOFOLLOW fd for the parent. An existing entry has to be a
  directory (fstatat AT_SYMLINK_NOFOLLOW); anything else is refused, and a
  directory is left alone. hive-c0re's own create_dir_all went: its /run
  is read-only under ProtectSystem=strict.
- The container's `hive-agent-user-migrate` activation chowns that dir to
  the agent user and sets 0751, the same way it already handles state/ and
  harness/. It refuses a symlink or non-directory there, since `test -d`
  and chmod follow links. No host-side passwd parse, and no window where
  the dir is world-writable.
- `/run/hyperhive/agents/<name>` stays created by hive-c0re itself
  (`ensure_agent_runtime_dir`). It holds the `mcp.sock` that hive-c0re
  binds as hive-core, so it must not become root- or agent-owned.
- The `/run/hive-agent` parent is declared in hive-priv.nix, `0755
  root:root`, instead of hive-gateway's hive-core rule. hive-priv is its
  only writer now, and hive-priv's ReadWritePaths needs it to exist.
- The manager start in `ensure_root_agent` now goes through
  `converge_start_preamble` + `start_with_fallback`. It was a bare start,
  so after a reboot the manager's bind sources existed only because of the
  tmpfiles file, and its limits drop-in did not exist at all.
- Removed: `sync_tmpfiles`, `agent_uid_gid` / `parse_passwd_uid_gid`,
  `priv_client::sync_agent_tmpfiles`, `AgentTmpfilesEntry`, the tmpfiles
  body builder and their tests, plus the three call sites.
- Legacy: hive-priv unlinks the file at every start, ignoring ENOENT.
  `SyncAgentTmpfiles` stays one release as a payload-ignoring variant that
  does the same unlink and returns Ok, for an older hive-c0re.

Salvaged from #4752: the boundary.md correction that nginx only dials,
because ProtectSystem=strict makes its /run read-only.

Behaviour change: a manual `nixos-container start h-<name>` right after a
reboot, before hive-c0re has started that agent, now fails on a missing
bind source instead of starting.

Closes #4742
2026-09-27 18:55:33 +02:00
..
agent-forge-bao.nix module-eval: pin the agent forge-token fetch and tea-login's removal 2026-09-24 17:48:53 +02:00
agent-icon.nix nix: split module-eval into per-subsystem checks 2026-09-20 04:25:54 +02:00
agent-matrix.nix hive-matrix-mcp: read the main account's token from the store too 2026-09-25 08:31:01 +02:00
agent-memory.nix nix: split module-eval into per-subsystem checks 2026-09-20 04:25:54 +02:00
agent-otel.nix module-eval: assert the severity table once, not once per tier 2026-09-20 14:23:56 +02:00
agent-plugins.nix nix: split module-eval into per-subsystem checks 2026-09-20 04:25:54 +02:00
agent-queue-bao.nix agent: fetch this agent's own swarm-queue credential from the store 2026-09-21 20:44:52 +02:00
agent-user.nix hive-priv: create agent socket dirs on start; drop hyperhive-agents.conf 2026-09-27 18:55:33 +02:00
bao-basics.nix nix: split module-eval into per-subsystem checks 2026-09-20 04:25:54 +02:00
bao-controller.nix swarm-controller: mint each agent's matrix account with the swarm's token 2026-09-25 08:31:01 +02:00
bao-grants.nix hive-matrix: load the swarm's appservice and promote its sender 2026-09-25 08:31:01 +02:00
bao-matrix-reader.nix nix: gate hive-c0re on deploy.hive-controller.enable, drop hyperhive.enable 2026-09-26 01:19:49 +02:00
bao-otel-collector.nix swarm-bao: stop linking the container's journal onto the host 2026-09-25 04:02:08 +02:00
core-toggle.nix module-eval: read the services-leaf narrowing off a forge host 2026-09-26 01:39:22 +02:00
forge-placement.nix hive-forge: a first authelia login creates the forge account 2026-09-25 08:29:56 +02:00
grafana.nix swarm-bao: stamp collector's service.name as "bao" 2026-09-25 08:30:25 +02:00
hive-otel.nix swarm-bao: give the store's collector an explicit self-telemetry port 2026-09-23 18:04:33 +02:00
hive-tls.nix hive-tls: renew the swarm-services leaf on a daily timer 2026-09-25 23:38:36 +02:00
journald-severity.nix module-eval: assert the severity table once, not once per tier 2026-09-20 14:23:56 +02:00
lib.nix nix: gate hive-c0re on deploy.hive-controller.enable, drop hyperhive.enable 2026-09-26 01:19:49 +02:00
matrix-core.nix nix: split module-eval into per-subsystem checks 2026-09-20 04:25:54 +02:00
name-guards.nix swarm-bao: give the store forwarder's OIDC reader its own bao identity 2026-09-25 00:37:31 +02:00
nats-authelia.nix nix: address the swarm IdP by its domain, not by who runs it 2026-09-21 18:14:28 +02:00
nats-tls.nix swarm: default every queue URL to the queue's name on every hive 2026-09-24 17:26:31 +02:00
secret-publisher.nix nix: the store's own collector scrapes its metrics listener 2026-09-21 17:19:52 +02:00
swarm-otel-core.nix nix: ship the journals of the units an apply can leave failed 2026-09-24 15:14:44 +02:00
swarm-otel-identity.nix swarm-bao: refuse a remote reader that named seven of the eight leaves 2026-09-23 10:11:42 +02:00
swarm-services-switch.nix nix: gate hive-c0re on deploy.hive-controller.enable, drop hyperhive.enable 2026-09-26 01:19:49 +02:00