Fix nix references in prose that no longer resolve
Nine of the 38 .nix tokens mentioned anywhere in *.rs did not name anything that exists. Twelve mentions, five distinct targets: hive-c0re.nix, hive-gateway.nix and hive-forge.nix are all directories now; nix/modules/ is not a directory we have; hive-forge-tools.nix was a bash script the binary replaced and is gone. Where the reference is load-bearing it is corrected rather than deleted, because the reference is the point: a comment saying a constant must match a nix literal is only useful if you can open the file it names. Where the module member was unambiguous the path now names it exactly. paths.rs's STATE_ROOT marker was the worst of them: it claimed the value came from services.hyperhive.c0re.statePath, in hive-c0re.nix. Neither exists. The option is not declared anywhere and the file is a directory, so a "must match" contract pointed at two things that cannot be opened. /var/lib/hyperhive is hardcoded on both sides, which is what the comment now says. hive-forge-tools.nix keeps no replacement: naming a file that was deliberately deleted helps nobody, and "replaces a prior bash script" is complete without it. Measured before and after with the same command: 9 unresolved of 38 before, 4 of 35 after. The remaining four are an example path in a doc comment, an upstream nixpkgs path, and two from one synthetic test fixture.
This commit is contained in:
parent
5593fa76bb
commit
06e8a9a09e
9 changed files with 17 additions and 13 deletions
|
|
@ -31,12 +31,14 @@ use std::path::{Path, PathBuf};
|
|||
pub use hive_host_sock::{AGENTS_ROOT, GATEWAY_HTPASSWD, HOST_SOCKET, agent_state_dir};
|
||||
|
||||
/// Root of all hive-c0re persistent state.
|
||||
// nix: bind-mount source `services.hyperhive.c0re.statePath` (hive-c0re.nix) — must match.
|
||||
// nix: the same literal is written in `nix/host-modules/hive-c0re/default.nix` — must match.
|
||||
// Not option-driven: there is no `statePath` option, the path is hardcoded both sides.
|
||||
pub const STATE_ROOT: &str = "/var/lib/hyperhive";
|
||||
|
||||
/// `/run/hyperhive` — hive-c0re's runtime root (host admin socket, the
|
||||
/// per-agent runtime dirs). Regenerated each boot; not persistent state.
|
||||
// nix: `RuntimeDirectory=hyperhive` on the hive-c0re service (hive-c0re.nix) — must match.
|
||||
// nix: `RuntimeDirectory=hyperhive` on the hive-c0re service
|
||||
// (`nix/host-modules/hive-c0re/default.nix`) — must match.
|
||||
// priv-sock: `hive_priv_sock::AGENT_RUNTIME_ROOT` is `RUNTIME_ROOT + "/agents"` and must
|
||||
// stay in sync; the privsep boundary prevents importing across the crate.
|
||||
pub const RUNTIME_ROOT: &str = "/run/hyperhive";
|
||||
|
|
@ -247,7 +249,8 @@ pub fn gateway_agents_conf() -> PathBuf {
|
|||
/// `forge-core-token` — the hive-c0re forge account API token. A `&str`
|
||||
/// (used in `Path::new` + user-facing `format!` messages), so it stays a
|
||||
/// const rather than a `PathBuf` fn.
|
||||
// nix: bind-mounted into the forge container / read at provisioning (hive-forge.nix) — must match.
|
||||
// nix: read at provisioning; the same literal is in
|
||||
// `nix/host-modules/hive-c0re/default.nix` and `nix/host-modules/hive-ci.nix` — must match.
|
||||
pub const FORGE_CORE_TOKEN: &str = "/var/lib/hyperhive/forge-core-token";
|
||||
|
||||
/// `matrix-register-token` — shared matrix registration token.
|
||||
|
|
|
|||
Loading…
Reference in a new issue