1
1
Fork 0
mirror of https://github.com/NixOS/nix.git synced 2025-11-09 20:16:03 +01:00

Merge pull request #13455 from DeterminateSystems/gustavderdrache/fix-sandbox-ifdef

Address ifdef problem with macOS/BSD sandboxing
This commit is contained in:
Sergei Zimmerman 2025-07-12 02:09:14 +03:00 committed by GitHub
commit ab3cd76e73
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 4 additions and 1 deletions

View file

@ -14,6 +14,8 @@ jobs:
with: with:
fetch-depth: 0 fetch-depth: 0
- uses: cachix/install-nix-action@v31 - uses: cachix/install-nix-action@v31
with:
install_url: "https://releases.nixos.org/nix/nix-2.29.1/install"
- run: nix --experimental-features 'nix-command flakes' flake show --all-systems --json - run: nix --experimental-features 'nix-command flakes' flake show --all-systems --json
tests: tests:
@ -36,6 +38,7 @@ jobs:
fetch-depth: 0 fetch-depth: 0
- uses: cachix/install-nix-action@v31 - uses: cachix/install-nix-action@v31
with: with:
install_url: "https://releases.nixos.org/nix/nix-2.29.1/install"
# The sandbox would otherwise be disabled by default on Darwin # The sandbox would otherwise be disabled by default on Darwin
extra_nix_config: | extra_nix_config: |
sandbox = true sandbox = true

View file

@ -197,7 +197,7 @@ bool useBuildUsers()
#ifdef __linux__ #ifdef __linux__
static bool b = (settings.buildUsersGroup != "" || settings.autoAllocateUids) && isRootUser(); static bool b = (settings.buildUsersGroup != "" || settings.autoAllocateUids) && isRootUser();
return b; return b;
#elif defined(__APPLE__) && defined(__FreeBSD__) #elif defined(__APPLE__) || defined(__FreeBSD__)
static bool b = settings.buildUsersGroup != "" && isRootUser(); static bool b = settings.buildUsersGroup != "" && isRootUser();
return b; return b;
#else #else