priv: derive flake ref from agent name; WriteNspawnFlags takes flags only
This commit is contained in:
parent
8d5e97ce9f
commit
89d0937473
3 changed files with 64 additions and 31 deletions
|
|
@ -29,10 +29,12 @@ pub enum PrivRequest {
|
|||
KillContainer { name: String },
|
||||
|
||||
/// `nixos-container update <name> --flake <flake_ref>`
|
||||
UpdateContainer { name: String, flake_ref: String },
|
||||
/// The flake ref is derived from `name` by hive-priv.
|
||||
UpdateContainer { name: String },
|
||||
|
||||
/// `nixos-container create <name> --flake <flake_ref>`
|
||||
CreateContainer { name: String, flake_ref: String },
|
||||
/// The flake ref is derived from `name` by hive-priv.
|
||||
CreateContainer { name: String },
|
||||
|
||||
/// `nixos-container destroy <name>`
|
||||
DestroyContainer { name: String },
|
||||
|
|
@ -42,9 +44,10 @@ pub enum PrivRequest {
|
|||
|
||||
// --- Config file writes ---
|
||||
|
||||
/// Overwrite `/etc/nixos-containers/<container>.conf` with new content.
|
||||
/// Written by `lifecycle::set_nspawn_flags` to inject `EXTRA_NSPAWN_FLAGS`.
|
||||
WriteNspawnConf { container: String, content: String },
|
||||
/// Update `/etc/nixos-containers/<container>.conf`: strip network-isolation
|
||||
/// vars, force `PRIVATE_NETWORK=0`, and set `EXTRA_NSPAWN_FLAGS`.
|
||||
/// Written by `lifecycle::set_nspawn_flags`.
|
||||
WriteNspawnFlags { container: String, extra_nspawn_flags: String },
|
||||
|
||||
/// Write `/run/systemd/system/container@<container>.service.d/hyperhive-limits.conf`
|
||||
/// with `[Service]\nMemoryMax=<memory_max>\nCPUQuota=<cpu_quota>\n`.
|
||||
|
|
|
|||
Loading…
Reference in a new issue