From 8f3008959c708fa6e64f9c6ae5c3af749e0a734c Mon Sep 17 00:00:00 2001 From: Terje Larsen Date: Tue, 14 Nov 2023 22:23:31 +0000 Subject: [PATCH 1/2] fix: tarball builder unable to remove /var/empty Fixes #337 --- modules/build-tarball.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/build-tarball.nix b/modules/build-tarball.nix index 577f0448..f7502a47 100644 --- a/modules/build-tarball.nix +++ b/modules/build-tarball.nix @@ -56,7 +56,7 @@ in root=$(mktemp -p "''${TMPDIR:-/tmp}" -d nixos-wsl-tarball.XXXXXXXXXX) # FIXME: fails in CI for some reason, but we don't really care because it's CI - trap 'rm -rf "$root" || true' INT TERM EXIT + trap 'chattr -Rf -i "$root" || true && rm -rf "$root" || true' INT TERM EXIT chmod o+rx "$root" From 3df1967cb85cbd683b61377e4d88bf09b72211dd Mon Sep 17 00:00:00 2001 From: Terje Larsen Date: Wed, 15 Nov 2023 00:25:07 +0000 Subject: [PATCH 2/2] fix: tarball builder unable to run with HOME set Fixes #338 --- modules/build-tarball.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/build-tarball.nix b/modules/build-tarball.nix index f7502a47..4109ed2f 100644 --- a/modules/build-tarball.nix +++ b/modules/build-tarball.nix @@ -68,7 +68,7 @@ in --substituters "" echo "[NixOS-WSL] Adding channel..." - nixos-enter --root "$root" --command 'nix-channel --add https://github.com/nix-community/NixOS-WSL/archive/refs/heads/main.tar.gz nixos-wsl' + nixos-enter --root "$root" --command 'HOME=/root nix-channel --add https://github.com/nix-community/NixOS-WSL/archive/refs/heads/main.tar.gz nixos-wsl' echo "[NixOS-WSL] Adding default config..." install -Dm644 ${defaultConfig} "$root/etc/nixos/configuration.nix"