Important
Determinate Systems has upstreamed the fixes in this repo. So this is no longer needed.
This is a fix for when Nix breaks after macOS system updates.
It installs a LaunchDaemon that will run on system boot and fix the
broken /etc/zshrc
and /etc/bashrc
files. You can also run it manually.
# If you already had Nix installed and it is already broken,
# you will need to first source nix into your current shell.
. '/nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh'
# Then you can run the fixer. Note this will prompt for your password
# as it needs to run as root.
nix run github:mrhenry/nix-darwin-fixer -- fix
# Now open a new shell and you should be good to go.
nix --version
# If you already had Nix installed and it is already broken,
# you will need to first source nix into your current shell.
. '/nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh'
# Then you can run the fixer. Note this will prompt for your password
# as it needs to run as root.
nix run github:mrhenry/nix-darwin-fixer -- install
# Now open a new shell and you should be good to go.
nix --version
# This will remove all files installed by the installer.
nix run github:mrhenry/nix-darwin-fixer -- uninstall