I'm running into an issue where I get an error if I try to set any system defaults as a non-root user. For example, trying to set system.defaults.dock.autohide = true (this is the only default I'm setting) causes this error:
defaults[41585:2126857] Could not write domain com.apple.dock; exiting
Unsurprisingly, this is same error returned if I were to run run defaults write com.apple.dock autohide true without sudo. I'm able to use sudo darwin-rebuild switch to apply the defaults. The real issue comes in when I try to use homebrew since it no longer supports being ran as root, so running sudo darwin-rebuild switch returns this error:
Error: Running Homebrew as root is extremely dangerous and no longer supported. As Homebrew does not drop privileges on installation you would be giving all build scripts full access to your system.
I was able to isolate the conflict to homebrew and system.defaults:
Commenting out my homebrew config and running sudo darwin-rebuild switch causes no issues and applies the defaults successfully.
Commenting out my defaults config instead and running darwin-rebuild switch causes no issues and installs the homebrew packages successfully.
I'm able to manually run sudo defaults write and have granted Full Disk Access to my terminal application (kitty), but I also have the issue in Terminal and Alacritty when running darwin-rebuild switch without sudo.
I'm running into an issue where I get an error if I try to set any system defaults as a non-root user. For example, trying to set
system.defaults.dock.autohide = true
(this is the only default I'm setting) causes this error:defaults[41585:2126857] Could not write domain com.apple.dock; exiting
Unsurprisingly, this is same error returned if I were to run run
defaults write com.apple.dock autohide true
without sudo. I'm able to usesudo darwin-rebuild switch
to apply the defaults. The real issue comes in when I try to use homebrew since it no longer supports being ran as root, so runningsudo darwin-rebuild switch
returns this error:Error: Running Homebrew as root is extremely dangerous and no longer supported. As Homebrew does not drop privileges on installation you would be giving all build scripts full access to your system.
I was able to isolate the conflict to homebrew and
system.defaults
:sudo darwin-rebuild switch
causes no issues and applies the defaults successfully.darwin-rebuild switch
causes no issues and installs the homebrew packages successfully.I'm able to manually run
sudo defaults write
and have granted Full Disk Access to my terminal application (kitty), but I also have the issue in Terminal and Alacritty when runningdarwin-rebuild switch
without sudo.