From 77a9745d7ac675883fdbe8c448b5b94904cd2d2a Mon Sep 17 00:00:00 2001 From: Daiderd Jordan Date: Sat, 28 Jul 2018 15:52:36 +0200 Subject: [PATCH] nix: don't use /tmp for the tests on darwin Unlike on linux these are not namespaced per user so this will cause build failures if /tmp/nix-test was not removed by a previous build if the nixbld user id doesn't match by accident. Nix already creates a unique tempdir for builds so we can use that instead. Fixes #44172 --- pkgs/tools/package-management/nix/default.nix | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pkgs/tools/package-management/nix/default.nix b/pkgs/tools/package-management/nix/default.nix index 07c130f1cb3..5c8341941ed 100644 --- a/pkgs/tools/package-management/nix/default.nix +++ b/pkgs/tools/package-management/nix/default.nix @@ -71,7 +71,9 @@ let doInstallCheck = true; # not cross # socket path becomes too long otherwise - preInstallCheck = lib.optional stdenv.isDarwin "export TMPDIR=/tmp"; + preInstallCheck = lib.optional stdenv.isDarwin '' + export TMPDIR=$NIX_BUILD_TOP + ''; separateDebugInfo = stdenv.isLinux;