Help fixing MacOS Catalina install

I have attempted to reinstall Nix several times and have run into issues. I used to have a working Mojave installation so that I could easily install all-hies but it broke with Catalina I believe. I’ve disabled system integrity protection to attempt to fix this issue but I’m having no luck.

ls -la / produces the following: lrwxr-xr-x 1 root wheel 14 Jun 30 18:13 nix -> /usr/local/nix

I’ve already deleted /usr/local/nix but I can’t remove the symlink.

rm -rf /nix produces rm: /nix: Permission denied

Trying to run sh <(curl https://nixos.org/nix/install) --darwin-use-unencrypted-nix-store-volume

seems to do nothing:

  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0

I downloaded the install script manually instead and tried to run it:

downloading Nix 2.3.6 binary tarball for x86_64-darwin from 'https://releases.nixos.org/nix/nix-2.3.6/nix-2.3.6-x86_64-darwin.tar.xz' to '/var/folders/mk/kl1n81y967n6l1zfmt70__300000gn/T/nix-binary-tarball-unpack.XXXXXXXXXX.WRK2wM2v'...
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 26.4M  100 26.4M    0     0  12.4M      0  0:00:02  0:00:02 --:--:-- 12.4M
Note: a multi-user installation is possible. See https://nixos.org/nix/manual/#sect-multi-user-installation
Creating volume and mountpoint /nix.

     ------------------------------------------------------------------ 
    | This installer will create a volume for the nix store and        |
    | configure it to mount at /nix.  Follow these steps to uninstall. |
     ------------------------------------------------------------------ 

  1. Remove the entry from fstab using 'sudo vifs'
  2. Destroy the data volume using 'diskutil apfs deleteVolume'
  3. Remove the 'nix' line from /etc/synthetic.conf or the file

error: /nix is a symlink, please remove it and make sure it's not in synthetic.conf (in which case a reboot is required)
  /nix -> /usr/local/nix

Pretty lost on how to fix my install at this point. Any help would be appreciated.

Due to the Catallina secure policy, / cannot be written directly. As the ouput, you should read the document about nix installation to create /nix by yourself, and then run the nix installation.

And you problem is that /nix exists, you may need to delete it and use another way, or open the option of symlink support for nix

Did you use sudo rm -rf /nix ?

You may also want to check whether there is a /nix entry in /etc/synthetic.conf. This file is used in Catalina to synthesize (they are not actually created on the real file system) top-level directories or symbolic links.

Thanks! Removing the entry in /etc/synthetic.conf did the trick.

1 Like