pin the declared closure once per rebuild and seed the marker from the running closure
This commit is contained in:
parent
47c2acb640
commit
4356f3840c
1 changed files with 456 additions and 95 deletions
|
|
@ -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.
|
||||
|
|
|
|||
Loading…
Reference in a new issue