@@ -32,10 +32,8 @@ let
3232 fi
3333 fi
3434
35− # Start the regular stage 1 script, passing the bind-mounted
36− # notification socket from the host to allow the container
37− # systemd to signal readiness to the host systemd.
38− NOTIFY_SOCKET=/var/lib/private/host-notify exec "$1"
35+ # Start the regular stage 1 script.
36+ exec "$1"
3937 '';
4038
4139 system = config.nixpkgs.system;
@@ -326,19 +324,17 @@ in
326324 fi
327325 ''}
328326
329− rm -f $root/var/lib/private/host-notify
330−
331327 # Run systemd-nspawn without startup notification (we'll
332328 # wait for the container systemd to signal readiness).
333− EXIT_ON_REBOOT=1 NOTIFY_SOCKET= \
329+ EXIT_ON_REBOOT=1 \
334330 exec ${config.systemd.package}/bin/systemd-nspawn \
335331 --keep-unit \
336332 -M "$INSTANCE" -D "$root" $extraFlags \
337333 $EXTRA_NSPAWN_FLAGS \
334+ --notify-ready=yes \
338335 --bind-ro=/nix/store \
339336 --bind-ro=/nix/var/nix/db \
340337 --bind-ro=/nix/var/nix/daemon-socket \
341− --bind=/run/systemd/notify:/var/lib/private/host-notify \
342338 --bind="/nix/var/nix/profiles/per-container/$INSTANCE:/nix/var/nix/profiles" \
343339 --bind="/nix/var/nix/gcroots/per-container/$INSTANCE:/nix/var/nix/gcroots" \
344340 --setenv PRIVATE_NETWORK="$PRIVATE_NETWORK" \
@@ -404,8 +400,6 @@ in
404400
405401 Type = "notify";
406402
407− NotifyAccess = "all";
408−
409403 # Note that on reboot, systemd-nspawn returns 133, so this
410404 # unit will be restarted. On poweroff, it returns 0, so the
411405 # unit won't be restarted.