Workaround a sandboxing issues

https://github.com/NixOS/nix/issues/4119
This commit is contained in:
Jeremy Wall 2023-12-26 21:40:20 -06:00
parent eac01c9ab3
commit ff8a7082ed

View File

@ -1,9 +1,10 @@
{ pkgs, ... }: { pkgs, config, lib, ... }:
{ {
nix = { nix = {
package = pkgs.nix; package = pkgs.nix;
settings.sandbox = true; # SEE: https://github.com/NixOS/nix/issues/4119#issuecomment-1734738812
settings.sandbox = "relaxed";
extraOptions = '' extraOptions = ''
experimental-features = nix-command flakes experimental-features = nix-command flakes
''; '';
@ -52,6 +53,11 @@
# programs.bash.enable = true; # default shell on catalina # programs.bash.enable = true; # default shell on catalina
# programs.fish.enable = true; # programs.fish.enable = true;
system.systemBuilderArgs = lib.mkIf (config.nix.settings.sandbox == "relaxed") {
sandboxProfile = ''
(allow file-read* file-write* process-exec mach-lookup (subpath "${builtins.storeDir}"))
'';
};
# Used for backwards compatibility, please read the changelog before changing. # Used for backwards compatibility, please read the changelog before changing.
# $ darwin-rebuild changelog # $ darwin-rebuild changelog
system.stateVersion = 4; system.stateVersion = 4;