Skip to content

Instantly share code, notes, and snippets.

@fkowal
Forked from EncodePanda/macos-catalina-nix.md
Created December 11, 2019 14:57
Show Gist options
  • Save fkowal/2df5ec79877b2390609968c35d53939d to your computer and use it in GitHub Desktop.
Save fkowal/2df5ec79877b2390609968c35d53939d to your computer and use it in GitHub Desktop.

Since macOS Catalina, the root drive is read-only. The solution is to create a separate APFS volume and a “synthetic” /nix directory which points to it:

# Check if /nix exists, if not:
echo 'nix' | sudo tee -a /etc/synthetic.conf
# this will create a "synthetic" empty directory /nix

# REBOOT so macOS sees the synthetic directory

# After rebooting, create an APFS volume for Nix
# make sure to replace disk1 with the correct disk number, if different.
sudo diskutil apfs addVolume disk1 APFSX Nix -mountpoint /nix
sudo diskutil enableOwnership /nix
sudo chflags hidden /nix  # Don't show the Nix volume on the desktop
echo "LABEL=Nix /nix apfs rw" | sudo tee -a /etc/fstab

# Install Nix as usual
curl https://nixos.org/nix/install | sh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment