feat(#1003): inject pkgs.path into meta flake as explicit nixpkgs.url

meta flake was using `nixpkgs.follows = "hyperhive/nixpkgs"` but
`hyperhive` is a store-path input, so nix resolves hyperhive's own
pinned lock rather than the host's follows-substituted version.
When an operator sets `inputs.hyperhive.inputs.nixpkgs.follows =
"nixpkgs"` in their host flake, the meta flake was silently ignoring
it and using hyperhive's pinned nixpkgs instead.

Fix: hive-c0re.nix injects `--nixpkgs-flake path:${pkgs.path}` into
the daemon's ExecStart. `pkgs` IS the host's nixpkgs when follows is
set; otherwise it's hyperhive's own pin — so the meta flake gets the
right nixpkgs in both cases. render_flake emits `nixpkgs.url = "..."`
(explicit) when nixpkgs_flake is non-empty, falling back to the old
`follows` form when empty for backward compat.
This commit is contained in:
atlas 2026-06-01 22:23:33 +02:00
commit fe5a41288d
9 changed files with 97 additions and 37 deletions

View file

@ -185,6 +185,7 @@ async fn port_collision(self_name: &str) -> Option<String> {
pub async fn spawn(
name: &str,
hyperhive_flake: &str,
nixpkgs_flake: &str,
agent_dir: &Path,
proposed_dir: &Path,
applied_dir: &Path,
@ -211,6 +212,7 @@ pub async fn spawn(
let agents = agents_after_spawn(name).await?;
crate::meta::sync_agents(
hyperhive_flake,
nixpkgs_flake,
dashboard_port,
operator_pronouns,
context_window_tokens,
@ -349,6 +351,7 @@ pub async fn destroy(name: &str) -> Result<()> {
pub async fn rebuild(
name: &str,
hyperhive_flake: &str,
nixpkgs_flake: &str,
agent_dir: &Path,
applied_dir: &Path,
claude_dir: &Path,
@ -366,6 +369,7 @@ pub async fn rebuild(
let agents = agents_for_meta(None).await?;
crate::meta::sync_agents(
hyperhive_flake,
nixpkgs_flake,
dashboard_port,
operator_pronouns,
context_window_tokens,