diff --git a/src/libutil/util.cc b/src/libutil/util.cc index 1f923fe6bc0f..c36103f4a6b1 100644 --- a/src/libutil/util.cc +++ b/src/libutil/util.cc @@ -375,7 +375,7 @@ void deletePath(const Path & path, unsigned long long & bytesFreed) static Path tempName(Path tmpRoot, const Path & prefix, bool includePid, int & counter) { - tmpRoot = canonPath(tmpRoot.empty() ? getEnv("TMPDIR", "/tmp") : tmpRoot, true); + tmpRoot = canonPath(tmpRoot.empty() ? getEnv("NIX_TMPDIR", "/nix/var/tmp") : tmpRoot, true); if (includePid) return (format("%1%/%2%-%3%-%4%") % tmpRoot % prefix % getpid() % counter++).str(); else