about summary refs log tree commit diff
path: root/nixos/modules/installer
diff options
context:
space:
mode:
authormisuzu <bakalolka@gmail.com>2020-04-25 13:00:05 +0300
committermisuzu <bakalolka@gmail.com>2020-04-25 14:37:36 +0300
commit5700232c3fadd8e5f02f21c5e99753544482b4d4 (patch)
treebeb41b134f20b424237bc007015ef447a62a2bd8 /nixos/modules/installer
parent93aabab7605c21f5962df2dffa7fee9ac17ba848 (diff)
downloadnixlib-5700232c3fadd8e5f02f21c5e99753544482b4d4.tar
nixlib-5700232c3fadd8e5f02f21c5e99753544482b4d4.tar.gz
nixlib-5700232c3fadd8e5f02f21c5e99753544482b4d4.tar.bz2
nixlib-5700232c3fadd8e5f02f21c5e99753544482b4d4.tar.lz
nixlib-5700232c3fadd8e5f02f21c5e99753544482b4d4.tar.xz
nixlib-5700232c3fadd8e5f02f21c5e99753544482b4d4.tar.zst
nixlib-5700232c3fadd8e5f02f21c5e99753544482b4d4.zip
nixos/nixos-installer: use temporary directory on target filesystem
nix build should store it's temporary files on target filesystem.
This should fix 'No space left on device' on systems
with low amount of RAM when there is a need to build something
like Linux kernel
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 defc46ad2a72..19676f4e7351 100644
--- a/nixos/modules/installer/tools/nixos-install.sh
+++ b/nixos/modules/installer/tools/nixos-install.sh
@@ -83,8 +83,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"