From 5700232c3fadd8e5f02f21c5e99753544482b4d4 Mon Sep 17 00:00:00 2001 From: misuzu Date: Sat, 25 Apr 2020 13:00:05 +0300 Subject: [PATCH] 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 --- nixos/modules/installer/tools/nixos-install.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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"