1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-06-28 22:01:15 +02:00

Set $HOME=/proc/homeless-shelter on Linux, and /homeless-shelter on OSX.

This commit is contained in:
Noam Yorav-Raphael 2024-08-19 20:18:08 +03:00
parent 77d84a8d8b
commit 62b9a26f60
2 changed files with 9 additions and 1 deletions

View file

@ -102,7 +102,14 @@ void handleDiffHook(
}
}
// We want $HOME to be un-creatable in the sandbox. On Linux,
// you can't create anything inside /proc since it's a virtual filesystem.
// On Darwin it seems that `/homeless-shelter` is good enough.
#if __linux__
const Path LocalDerivationGoal::homeDir = "/proc/homeless-shelter";
#else
const Path LocalDerivationGoal::homeDir = "/homeless-shelter";
#endif
LocalDerivationGoal::~LocalDerivationGoal()