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.
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 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.
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.
Now you can install nix as normal.
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.