summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--guix/utils.scm5
1 files changed, 3 insertions, 2 deletions
diff --git a/guix/utils.scm b/guix/utils.scm
index b61ff2477d..34a5e6c971 100644
--- a/guix/utils.scm
+++ b/guix/utils.scm
@@ -600,8 +600,9 @@ REPLACEMENT."
   "Call PROC with a name of a temporary file and open output port to that
 file; close the file and delete it when leaving the dynamic extent of this
 call."
-  (let* ((template (string-copy "guix-file.XXXXXX"))
-         (out      (mkstemp! template)))
+  (let* ((directory (or (getenv "TMPDIR") "/tmp"))
+         (template  (string-append directory "/guix-file.XXXXXX"))
+         (out       (mkstemp! template)))
     (dynamic-wind
       (lambda ()
         #t)