Skip to content

Instantly share code, notes, and snippets.

View mbrasch's full-sized avatar

mbrasch mbrasch

  • Hamburg, Germany
View GitHub Profile
@mbrasch
mbrasch / README.md
Last active October 26, 2023 14:03
Broken Nix after macOS update

Unfortunately, macOS always overwrites the /etc/zshrc file during updates. This is a problem insofar as the hook for Nix is here (and has to be here). To circumvent this problem, you can use a launchd job to check on every system start whether this hook still exists and rewrite it if necessary:

  • create the file /Library/LaunchDaemons/org.nixos.darwin.check-zshrc-nix-hook.plist with the content mentioned below
  • set the correct user and access rights:
sudo chown root:wheel /Library/LaunchDaemons/org.nixos.darwin.check-zshrc-nix-hook.plist
sudo chmod u=rw,go=r /Library/LaunchDaemons/org.nixos.darwin.check-zshrc-nix-hook.plist