From e375223500ca0fd919b0e504eab65c6ddb5e4233 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Soko=C5=82owski?= Date: Fri, 13 Feb 2026 12:28:50 +0100 Subject: [PATCH] fix: nix /tmp permission errors on MacOS MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Because on MacOS Nix does not have proper filesystem namespacing like on linux the /tmp filesystem is the real /tmp on the machine. This can cause permission issues when different Nix build users creat it: > cannot create directory: /tmp/nim/koch_d Signed-off-by: Jakub SokoĊ‚owski --- nix/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nix/default.nix b/nix/default.nix index a030d5de..3ec55f7d 100644 --- a/nix/default.nix +++ b/nix/default.nix @@ -56,8 +56,6 @@ in stdenv.mkDerivation rec { # Disable CPU optimizations that make binary not portable. NIMFLAGS = "-d:disableMarchNative -d:git_revision_override=${revision}"; - # Avoid Nim cache permission errors. - XDG_CACHE_HOME = "/tmp"; makeFlags = targets ++ [ "V=${toString verbosity}" @@ -72,6 +70,8 @@ in stdenv.mkDerivation rec { ''; configurePhase = '' + # Avoid Nim cache permission errors. + export XDG_CACHE_HOME=$TMPDIR patchShebangs . vendor/nimbus-build-system > /dev/null make nimbus-build-system-paths '';