fix: nix /tmp permission errors on MacOS

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 <jakub@status.im>
This commit is contained in:
Jakub Sokołowski 2026-02-13 12:28:50 +01:00
parent d02f44ffd6
commit e375223500
No known key found for this signature in database
GPG Key ID: FE65CD384D5BF7B4

View File

@ -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
'';