diff --git a/nixos/tests/systemd-machinectl.nix b/nixos/tests/systemd-machinectl.nix index 4b6c8febbb04..8a525a036977 100644 --- a/nixos/tests/systemd-machinectl.nix +++ b/nixos/tests/systemd-machinectl.nix @@ -106,6 +106,8 @@ let } ]; + extraCommands = "mkdir -p usr"; + contents = [ { source = containerSystem + "/etc/os-release"; @@ -171,6 +173,7 @@ in systemd.tmpfiles.rules = [ "d /var/lib/machines/shared-decl 0755 root root - -" + "d /var/lib/machines/shared-decl/usr 0755 root root - -" ]; systemd.nspawn.shared-decl = { execConfig = { @@ -228,7 +231,7 @@ in machine.wait_until_succeeds("systemctl -M shared-decl is-active default.target"); machine.succeed("machinectl stop shared-decl"); - machine.succeed("mkdir -p ${containerRoot}"); + machine.succeed("mkdir -p ${containerRoot}/usr"); # start container with shared nix store by using same arguments as for systemd-nspawn@.service machine.succeed("systemd-run systemd-nspawn --machine=${containerName} --network-veth -U --bind-ro=/nix/store ${containerSystem}/init")