Skip to content

Commit

Permalink
chore(nix): enable the macOS sandbox, with caveats (#772)
Browse files Browse the repository at this point in the history
  • Loading branch information
dhess authored Jan 14, 2025
2 parents 7786b25 + 671bc0a commit 71ed8aa
Showing 1 changed file with 10 additions and 12 deletions.
22 changes: 10 additions & 12 deletions nix/darwinModules/config/defaults/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -30,19 +30,17 @@ in

nix.settings.trusted-users = [ "@admin" ];

# See https://gist.github.com/LnL7/1cfca66d17eba1f9936175926bf39de8.
# Enable the sandbox, but in order to work around issues with
# packages requiring too many paths, we add `/nix/store` by
# default. 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.
#
# XXX dhess - disabled, see:
# https://github.com/NixOS/nix/issues/2311
# nix.useSandbox = true;
# nix.sandboxPaths = [
# "/System/Library/Frameworks"
# "/System/Library/PrivateFrameworks"
# "/usr/lib"
# "/private/tmp"
# "/private/var/tmp"
# "/usr/bin/env"
# ];
# Ref:
# https://github.com/NixOS/nix/issues/4119#issuecomment-2561973914
nix.settings.sandbox = true;
nix.settings.extra-sandbox-paths = [ "/nix/store" ];

# We always run nix-daemon (multi-user mode).
services.nix-daemon.enable = true;
Expand Down

0 comments on commit 71ed8aa

Please sign in to comment.