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
This commit is contained in:
misuzu 2020-04-25 13:00:05 +03:00
parent 93aabab760
commit 5700232c3f

View File

@ -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"