fix bug
diff-pr / dix (pull_request) Canceled after 0s
flake-check / flake-check (pull_request) Canceled after 0s
lint / lint (pull_request) Canceled after 0s

This commit is contained in:
Autumn Liu
2026-09-11 15:59:27 -05:00
parent fa39169fee
commit 5ef48168f4
2 changed files with 13 additions and 7 deletions
+8 -7
View File
@@ -222,11 +222,13 @@ rec {
: Bind mounts, keyed by mount point.
`resources.devices`
: Host device nodes to expose, as paths. Bound into the container's `/dev`
and added to the unit's `DeviceAllow=` - the bind alone leaves the cgroup
denying `open()`. Nodes keep their host ownership, so a consumer inside
needs `isolation.privateUsers = "identity"` for the owning gid to mean
anything.
: Host device nodes to expose, as paths, added to the unit's
`DeviceAllow=`. nspawn populates a handful of privileged devices
(`/dev/kvm`, `/dev/net/tun`, ...) into the container's own `/dev` once
the cgroup allows it, and silently skips ones the host doesn't have -
no `resources.fs` bind mount needed. Nodes keep their host ownership,
so a consumer inside needs `isolation.privateUsers = "identity"` for
the owning gid to mean anything.
`isolation.nixDaemon`
: Whether the Nix daemon and CLI are available inside the container.
@@ -293,7 +295,6 @@ rec {
+ lib.optionalString useIdmap ":idmap"
) allBindMounts;
bindMountHostPaths = map (bm: bm.hostPath) (lib.attrValues allBindMounts);
deviceFlags = map (d: "--bind=${d}") devices;
inherit (deriveIdentity ifPrefix.nspawn name)
iface
mac
@@ -380,7 +381,7 @@ rec {
nixosContainer = {
inherit autoStart privateUsers;
bindMounts = { };
extraFlags = bindMountExtraFlags ++ deviceFlags;
extraFlags = bindMountExtraFlags;
privateNetwork = true;
extraVeths = linkVeths;
config =