summary refs log tree commit diff
path: root/nixos/modules/installer/tools
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 /nixos/modules/installer/tools
parent2f0cfde482e780dd7abcc8b4e1f51d160f74f7aa (diff)
downloadnixpkgs-1783cfde53a58b1fa38449e47f45dd65091de7ae.tar
nixpkgs-1783cfde53a58b1fa38449e47f45dd65091de7ae.tar.gz
nixpkgs-1783cfde53a58b1fa38449e47f45dd65091de7ae.tar.bz2
nixpkgs-1783cfde53a58b1fa38449e47f45dd65091de7ae.tar.lz
nixpkgs-1783cfde53a58b1fa38449e47f45dd65091de7ae.tar.xz
nixpkgs-1783cfde53a58b1fa38449e47f45dd65091de7ae.tar.zst
nixpkgs-1783cfde53a58b1fa38449e47f45dd65091de7ae.zip
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.
Diffstat (limited to 'nixos/modules/installer/tools')
-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 6469d9faa03..115b3d7a7c5 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[@]}"