about summary refs log tree commit diff
path: root/nixos/modules/installer
diff options
context:
space:
mode:
authorAlexey Shmalko <rasen.dubi@gmail.com>2020-05-08 18:40:24 +0300
committerGitHub <noreply@github.com>2020-05-08 18:40:24 +0300
commitafbab5a3f3e3e793d61c239ec73b9371c9bfc16b (patch)
tree7c41c9115cc8ab00b630989c17a5c19aab465e83 /nixos/modules/installer
parent8fc744839bdc6a23e37f6de9f67bd4916839acc9 (diff)
parent5700232c3fadd8e5f02f21c5e99753544482b4d4 (diff)
downloadnixlib-afbab5a3f3e3e793d61c239ec73b9371c9bfc16b.tar
nixlib-afbab5a3f3e3e793d61c239ec73b9371c9bfc16b.tar.gz
nixlib-afbab5a3f3e3e793d61c239ec73b9371c9bfc16b.tar.bz2
nixlib-afbab5a3f3e3e793d61c239ec73b9371c9bfc16b.tar.lz
nixlib-afbab5a3f3e3e793d61c239ec73b9371c9bfc16b.tar.xz
nixlib-afbab5a3f3e3e793d61c239ec73b9371c9bfc16b.tar.zst
nixlib-afbab5a3f3e3e793d61c239ec73b9371c9bfc16b.zip
Merge pull request #85996 from misuzu/nixos-install-low-memory
nixos/nixos-installer: use temporary directory on target filesystem
Diffstat (limited to 'nixos/modules/installer')
-rw-r--r--nixos/modules/installer/tools/nixos-install.sh5
1 files changed, 4 insertions, 1 deletions
diff --git a/nixos/modules/installer/tools/nixos-install.sh b/nixos/modules/installer/tools/nixos-install.sh
index 6e1d56af2ae5..1bccbbfaf245 100644
--- a/nixos/modules/installer/tools/nixos-install.sh
+++ b/nixos/modules/installer/tools/nixos-install.sh
@@ -87,8 +87,11 @@ if [[ ! -e $NIXOS_CONFIG && -z $system ]]; then
 fi
 
 # A place to drop temporary stuff.
+tmpdir="$(mktemp -d -p $mountPoint)"
 trap "rm -rf $tmpdir" EXIT
-tmpdir="$(mktemp -d)"
+
+# store temporary files on target filesystem by default
+export TMPDIR=${TMPDIR:-$tmpdir}
 
 sub="auto?trusted=1"