From e12188c0f2e01953055f981c7b77f3a934426ef3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= Date: Thu, 31 Dec 2020 09:14:28 +0100 Subject: [PATCH] nixos/systemd-confinment: use /var/empty as chroot mountpoint bind mounting directories into the nix-store breaks nix commands. In particular it introduces character devices that are not supported by nix-store as valid files in the nix store. Use `/var/empty` instead which is designated for these kind of use cases. We won't create any files beause of the tmpfs mounted. --- nixos/modules/security/systemd-confinement.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nixos/modules/security/systemd-confinement.nix b/nixos/modules/security/systemd-confinement.nix index afb81a2b56b..0a09a755e93 100644 --- a/nixos/modules/security/systemd-confinement.nix +++ b/nixos/modules/security/systemd-confinement.nix @@ -105,7 +105,7 @@ in { wantsAPIVFS = lib.mkDefault (config.confinement.mode == "full-apivfs"); in lib.mkIf config.confinement.enable { serviceConfig = { - RootDirectory = pkgs.runCommand rootName {} "mkdir \"$out\""; + RootDirectory = "/var/empty"; TemporaryFileSystem = "/"; PrivateMounts = lib.mkDefault true;