feat(guests): let a guest nest OCI containers (task 0009) #35
Reference in New Issue
Block a user
Delete Branch "task-0009-guest-nesting"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Adds a
nestingplacement field to the Host-side guest interface — a bool, off by default — that makes the OCI fallback a plain Guest.With
nestingon, the guest's container gains the prerequisites its interior needs to run Podman and other OCI containers:CAP_NET_ADMINcapability an OCI runtime uses to build its bridges and firewall rules, and/dev/net/tunand/dev/fusedevice nodes it reaches for to network those containers and back their overlay storage.Off, both the capability and device lists are empty, so a non-nesting guest is untouched.
A privileged container-backend guest already retains
CAP_SYS_ADMINand the broad nspawn capability set, so network administration is the one capability the runtime is missing.A new
nesting-sampleguest defines anoci-containersworkload on Podman in its interior, andneogaiaenables it withnestingon, so the whole path builds end to end through the Host'snix flake check— which pulls inpodmanand the generated container unit for the nested system.Deviations
nesting. The NixOS container backend setsDelegate = trueon every container unit unconditionally, so the delegated cgroup subtree an OCI runtime manages is always present. Re-emitting it undernestingwould be redundant, and forcing it off for non-nesting guests to make it literally "absent" would drop a harmless, useful default for no gain. The Skeleton records the prerequisite as satisfied-elsewhere with an absence-pointer comment.Review
Risk
Overall: HIGH
nix flake checkproves evaluation/build, not that the interior Podman workload actually runs.CAP_NET_ADMINplus/dev/net/tunand/dev/fuse, loosening nspawn confinement for any guest that opts in.optionalsgating.Unaddressed findings
Standards
limitsclump and flat-key repetition across the two guest blocks onneogaia(Duplicated Code / Data Clumps, judgement calls) — kept as-is: the Host file is deliberately a flat declarative checklist and the two guests are independent placements that happen to share modest caps, so a sharedletbinding would trade that flatness for little gain.Spec
nestingflag — accepted deviation, explained under Deviations above and recorded in the code with an absence-pointer comment.nesting-sampleguest is enabled permanently onneogaia— this is how acceptance criterion four is verified on the one Host'snix flake check, following the walking-skeleton guest's established precedent; it is a minimal smoke test and turns off with one line.— Claude