TLDR;
sudo chown -R user_name /nixUpdated @2024-12-08
!SHIT! The above answer is wrong!
It’s better not to change the permision of Nix Store by ourself.
First, try to check if the nix-daemon is stared:
sudo launchctl list | grep org.nixosIf not, start it:
sudo launchctl kickstart -k system/org.nixos.nix-daemonThen try to use `nix run` to rebuild the system (if you don’t have `/run/current-system/` in your system.
nix run nix-darwin --extra-experimental-features "nix-command flakes" -- switch --flake /path/to/your/flake.nixImportant Notes
When anything wired happend, remember to check if new nix command has permitted with Full Disk access.