Skip to content

Instantly share code, notes, and snippets.

@miuirussia
Created January 7, 2020 13:27
Show Gist options
  • Select an option

  • Save miuirussia/85ed6fb7dbdd2f087fdb6326df5efded to your computer and use it in GitHub Desktop.

Select an option

Save miuirussia/85ed6fb7dbdd2f087fdb6326df5efded to your computer and use it in GitHub Desktop.
  1. Upgrade to Catalina
  2. Save some space: sudo rm -rf /Users/Shared/Relocated\ Items/Security/nix (this is where my existing nix store got moved)
  3. Ask for a mountpoint: sudo bash -c "echo nix >> /etc/synthetic.conf"
  4. Reboot. This creates /nix as a synthetic, essentially read-only (mount-only?) folder.
  5. Run sudo diskutil apfs addVolume disk1 APFSX Nix -mountpoint /nix to create a volume and mount it on /nix.
  6. Run sudo bash -c 'echo "LABEL=Nix /nix apfs rw" >> /etc/fstab' to instruct macOS to remount on reboot.
  7. Run diskutil ap encryptVolume Nix -user disk to encrypt the volume (if desired, but there is really not much of a reason not to). You'll have to choose a passphrase and type it twice.
  8. Reboot. Make sure /nix is mounted and you have write access. If you have encrypted the volume, you will be asked for the passphrase and have the option of ticking a checkbox to save it in the keychain.
  9. Run bash <(curl https://nixos.org/nix/install). Notice that there is no need for sudo here as we have write access to /nix.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment