Nix is an extremely powerful package manager that uses a declarative functional programming language to describe dependencies. It stores all packages and build outputs in the nix store located at /nix. This makes it slightly tricky to install on macOS 10.15 (Catalina), because the new read only system volume would prevent creating or writing to /nix. A common workaround is to create a separate writable APFS volume and mount it at /nix.

Boot from install media, and install to Mojave volume Reboot your computer, hold down the Option key (⌥) before the Apple logo appears Choose the USB media (Mojave installer) Click 'Reinstall macOS' once the 'macOS Utilities' screen appears. To create a new APFS container, add a new partition to the Mac's internal data storage device (IDSD), and format it as APFS. Unfortunately, I don't know exactly how to do this; when I tried to add a new partition in macOS Recovery, the following message was displayed.

  • Installing macOS on a separate APFS volume APFS makes it easier than ever to switch between versions of macOS, including a beta (prerelease) version of macOS.
  • The installer will convert the drive where it is being installed on, no matter what. The command-line option to skip conversion is gone. Apple really wants to enforce APFS adoption. That means you need to install Mojave on a separate volume, which will then be in APFS format.
  • This makes it slightly tricky to install on macOS 10.15 (Catalina), because the new read only system volume would prevent creating or writing to /nix. A common workaround is to create a separate writable APFS volume and mount it at /nix. Before you start. As of May 21, 2020, this workaround has been baked directly into the nix installer.

Before you start

  1. As of May 21, 2020, this workaround has been baked directly into the nix installer. However, out of an abundance of caution, it will only work if you don't use FileVault encryption or your Mac is a 2018 or newer model with a T2 chip.
  2. If you use this workaround, your nix store will be unencrypted.
  3. If you use this workaround, you will not be able to install nix in multi-user mode.

The workaround

Try a normal install

Head over to https://nixos.org/download.html and follow instructions. It might work! Otherwise, if you see the following error, continue with the workaround.

Create a mount point

Create a root-level mount point at /nix using synthetic.conf (run man synthetic.conf in your terminal to find out more)

Reboot if it asks you to reboot.

Create an APFS volume

The following commands will create an APFS volume called Nix, mount it at /nix hide it from the Finder sidebar, and configure it to be mounted at boot.

Control

Install Nix

Now you can install nix as normal.

Can't Install Macos On Apfs

References

Installing Macos On A Separate Apfs Volume

This workaround was described and implemented by Daiderd Jordan. I mostly just followed along in the GitHub issue and took notes to help myself and others get up and running on macOS Catalina. The Nix manual has a section on macOS installation with lots of details also.