summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Hoang <enzime@users.noreply.github.com>2021-12-31 10:10:14 +1100
committerMichael Hoang <enzime@users.noreply.github.com>2021-12-31 10:10:14 +1100
commit1783cfde53a58b1fa38449e47f45dd65091de7ae (patch)
treef218becaa5514a15e9a8a3e3216460049f8f7809
parenttests/systemd-boot: Add tests for `extraFiles` (diff)
downloadnixpkgs-1783cfde53a58b1fa38449e47f45dd65091de7ae.tar.gz
nixos/nixos-enter: Don't passthru `TMPDIR`
`mktemp` tries to use the `TMPDIR` from `nixos-install` outside of the `chroot` instead of `/tmp` inside the `chroot` and fails. For some reason the `TMPDIR` is being passed through the `chroot` call. I haven't tested if other environment variables are being passed through that shouldn't be.
-rw-r--r--nixos/modules/installer/tools/nixos-enter.sh2
1 files changed, 2 insertions, 0 deletions
diff --git a/nixos/modules/installer/tools/nixos-enter.sh b/nixos/modules/installer/tools/nixos-enter.sh
index 6469d9faa038..115b3d7a7c5e 100644
--- a/nixos/modules/installer/tools/nixos-enter.sh
+++ b/nixos/modules/installer/tools/nixos-enter.sh
@@ -104,4 +104,6 @@ chroot_add_resolv_conf "$mountPoint" || print "ERROR: failed to set up resolv.co
chroot "$mountPoint" systemd-tmpfiles --create --remove --exclude-prefix=/dev 1>&2 || true
)
+unset TMPDIR
+
exec chroot "$mountPoint" "${command[@]}"