After an upgrade, many things will be broken. Here’s how to fix:
Use sudo
to create /etc/synthetic.conf
and add the following two
entries:
/etc/synthetic.conf
nix /System/Volumes/Data/nix run private/var/run/
This tells Darwin to create /nix
and /run
symlinks in the root on
next reboot.
The Catalina upgrade should have created a /Users/Shared/Relocated
Items/Security/nix
directory. Move it into its new place with the
following command:
$ sudo mv /Users/Shared/Relocated\ Items/Security/nix /System/Volumes/Data/nix
Oddly, this command will return immediately even though the target folder does not yet exist — it can take several minutes to show up.
Wait for it to show up, then reboot.
nix-darwin will want to symlink the files in /run/current-system/etc/
to /etc/
. Look in /run/current-system/etc/
to see which files need
to be renamed in /etc/
, for example:
$ sudo mv /etc/bashrc{,.orig} $ sudo mv /etc/zprofile{,.orig} $ sudo mv /etc/zshenv{,.orig} $ sudo mv /etc/zshrc{,.orig}
Edit your configuration.nix
and ensure that you have this:
environment.variables.NIX_IGNORE_SYMLINK_STORE = "1";
Source your current shell’s rc file, and rebuild the config:
$ . /run/current-system/etc/bashrc $ export NIX_IGNORE_SYMLINK_STORE=1 $ darwin-rebuild switch