Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(nix): enable the macOS sandbox, with caveats #772

Merged
merged 1 commit into from
Jan 14, 2025
Merged

Conversation

dhess
Copy link
Member

@dhess dhess commented Jan 14, 2025

It seems like most of the macOS sandbox issues have been resolved, except for the 64K sandbox program limit.

Here we enable the sandbox, but in order to work around this limit, we add /nix/store to the allowed paths by default. (Presumably the sandbox compiler is smart enough to replace multiple /nix/store/... paths with a single /nix/store parent path.)

This is less than optimal, but much safer than disabling the sandbox entirely, and probably safer than disabling the sandbox on a per-package, as-needed basis, as well.

Ref:
NixOS/nix#4119 (comment)

Also see:

NixOS/nixpkgs#346945
NixOS/nix#6836
NixOS/nix#4119
amarshall/home-manager@d7319b7 NixOS/nixpkgs#366245
NixOS/nix#2311

It seems like most of the macOS sandbox issues have been resolved,
except for the 64K sandbox program limit.

Here we enable the sandbox, but in order to work around this limit, we
add `/nix/store` to the allowed paths by default. (Presumably the
sandbox compiler is smart enough to replace multiple `/nix/store/...`
paths with a single `/nix/store` parent path.)

This is less than optimal, but much safer than disabling the sandbox
entirely, and probably safer than disabling the sandbox on a
per-package, as-needed basis, as well.

Ref:
NixOS/nix#4119 (comment)

Also see:

NixOS/nixpkgs#346945
NixOS/nix#6836
NixOS/nix#4119
amarshall/home-manager@d7319b7
NixOS/nixpkgs#366245
NixOS/nix#2311

Signed-off-by: Drew Hess <[email protected]>
@dhess dhess enabled auto-merge January 14, 2025 12:52
@dhess dhess added this pull request to the merge queue Jan 14, 2025
Merged via the queue into main with commit 71ed8aa Jan 14, 2025
29 checks passed
@dhess dhess deleted the dhess/macos-sandbox branch January 14, 2025 12:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant