From 5c2a7490cfb8f98c8a47fd9abedbae745c99df6b Mon Sep 17 00:00:00 2001 From: nikstur Date: Mon, 8 May 2023 21:59:02 +0200 Subject: [PATCH] nixos/systemd-repart: fix Since v253, systemd-repart tries to create temporary directories in /var/tmp. However, this directory doesn't exist in the initrd. This commit adds an enviroment variable to re-use the existing /tmp directory instead of /var/tmp. --- nixos/modules/system/boot/systemd/repart.nix | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/nixos/modules/system/boot/systemd/repart.nix b/nixos/modules/system/boot/systemd/repart.nix index 8f3a70023770..ed11d4a4ef3e 100644 --- a/nixos/modules/system/boot/systemd/repart.nix +++ b/nixos/modules/system/boot/systemd/repart.nix @@ -88,6 +88,11 @@ in # Override defaults in upstream unit. services.systemd-repart = { + # systemd-repart tries to create directories in /var/tmp by default to + # store large temporary files that benefit from persistence on disk. In + # the initrd, however, /var/tmp does not provide more persistence than + # /tmp, so we re-use it here. + environment."TMPDIR" = "/tmp"; # Unset the conditions as they cannot be met before activation because # the definition files are not stored in the expected locations. unitConfig.ConditionDirectoryNotEmpty = [ @@ -119,5 +124,4 @@ in ]; }; }; - }