Watch
0
0
Fork
You've already forked hyperhive
0

pin the declared closure once per rebuild and seed the marker from the running closure

This commit is contained in:
atlas 2026-11-02 00:42:45 +01:00 • committed by mara
commit 4356f3840c

View file

@ -123,13 +123,24 @@ pub fn applied_root() -> PathBuf {
}
/// `applied/.<name>.closure` — marker holding the store path of the swarm's
/// closure an agent was last swapped to or created from, which
/// [`crate::attic::closure::pending`] compares the record's with.
/// closure an agent was last swapped to or created from (or, once, the one its
/// container profile pointed at), which [`crate::attic::closure::pending`]
/// compares the record's with.
#[must_use]
pub fn applied_closure_marker(name: &str) -> PathBuf {
applied_root().join(format!(".{name}.closure"))
}
/// `/nix/var/nix/profiles/per-container/h-<name>/system` — the link `nix-env --set`
/// points at the closure an agent's container runs, as `hive-priv` writes it
/// on a swap and `nixos-container create` on a create.
#[must_use]
pub fn container_profile(name: &str) -> PathBuf {
Path::new("/nix/var/nix/profiles/per-container")
.join(format!("{}{name}", crate::lifecycle::AGENT_PREFIX))
.join("system")
}
/// `meta/` — plain state beside the hive's other files (`topology.json`,
/// the swarm limits, the permission seed files) and, on a hive that predates
/// `internal/meta`, a leftover git repo.