hyperhive/nix
Repository files (latest commit first)
Filename Latest commit message Latest commit date
atlas 09c1abe5b4 nix/hive-gateway: switch to JSON port table per mara on #740 (#15 v0, option B)
mara on PR #740 comment 9295: "we decided to go with the json" (issue #15 comment 9270:
"nginx container lives in system config, so it cannot be just rebuilt
from meta flake. go for the json file the c0re writes").

Drops:
- `cfg.agents` listOf str option
- Replicated FNV-1a hash + char-code table + manager-port special case
- Drift-hazard comment (no more rust↔nix constant sync)

Adds:
- `cfg.agentPortsFile = "/var/lib/hyperhive/agent-ports.json"` (default,
  nullable to disable) — path to a JSON map of `{ "<name>": <port> }`
  written by hive-c0re on every topology change.
- `agentPortsTable` reads the file at eval time via
  `builtins.fromJSON (builtins.readFile path)`, guarded by
  `builtins.pathExists` so a missing file gracefully defaults to `{}`.
- Per-agent locations generated via `lib.mapAttrs'` over the table —
  one location block per entry; empty table → empty attrset → no
  per-agent blocks, pre-#15 shape.

Rust-side dependency: hive-c0re needs to emit the JSON file on every
topology change. Coordinating with damocles via a separate ping — the
nix side ships now with safe defaults (missing file = no routes, no
behavior change vs main).

Verified:
- nix eval with `/tmp/test-agent-ports.json` → 4 per-agent blocks at
  correct ports (8178 iris, 8267 argus, 8304 atlas, 8549 damocles)
- nix eval with nonexistent file → only `/` location (graceful default)
- full container toplevel builds clean with matrix on

Empty file case mirrors the previous empty-list default — purely
additive, old `<host>:<port>/` direct reach untouched, no per-agent
blocks until c0re writes the JSON. Operator can also `null` the
option to disable entirely.
2026-05-31 12:49:53 +02:00
..
docs nix/docs: fix empty host options page — pick under services.hyperhive.* (#630) 2026-05-30 13:05:04 +02:00
forge-theme forge: use branding/hyperhive.svg for logo and favicon 2026-05-21 17:50:46 +02:00
modules nix/hive-gateway: switch to JSON port table per mara on #740 (#15 v0, option B) 2026-05-31 12:49:53 +02:00
packages hive-forge: rewrite bash CLI helper as a rust binary (closes #280) 2026-05-25 02:16:53 +02:00
templates harness: drop trailing /bin from systemd path entries so wrapper sudo resolves (#672 fixup) 2026-05-31 11:29:18 +02:00
assets.nix nix: split static runtime assets into their own derivation (#555) 2026-05-29 12:59:48 +02:00
frontend.nix frontend: npm dependency updates (#681) 2026-05-31 01:29:35 +02:00