Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)

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

(cherry picked from commit 77a9745d7ac675883fdbe8c448b5b94904cd2d2a)

+3 -1
+3 -1
pkgs/tools/package-management/nix/default.nix
··· 70 70 doInstallCheck = true; # not cross 71 71 72 72 # socket path becomes too long otherwise 73 - preInstallCheck = lib.optional stdenv.isDarwin "export TMPDIR=/tmp"; 73 + preInstallCheck = lib.optional stdenv.isDarwin '' 74 + export TMPDIR=$NIX_BUILD_TOP 75 + ''; 74 76 75 77 separateDebugInfo = stdenv.isLinux; 76 78