Skip to content

Instantly share code, notes, and snippets.

@ghedamat
Created May 17, 2020 14:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ghedamat/25c671a02923dbac6c140afe54276f9e to your computer and use it in GitHub Desktop.
Save ghedamat/25c671a02923dbac6c140afe54276f9e to your computer and use it in GitHub Desktop.
Nix on MacOS catalina workaround
# taken from https://github.com/NixOS/nix/issues/2925#issuecomment-539570232
#1. Check if /nix exists.
# If not, run
echo 'nix' | sudo tee -a /etc/synthetic.conf
#then reboot.
#2. Create an APFS volume for Nix:
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
#3. Install Nix:
sh <(curl https://nixos.org/nix/install)
#4. configure nix
# ensure that the following line is in your bashrc or zshrc, depending on which you use
if [ -e /Users/YOURUSERNAME/.nix-profile/etc/profile.d/nix.sh ]; then . /Users/YOURUSERNAME/.nix-profile/etc/profile.d/nix.sh; fi # added by Nix installer
# open a new terminal window and run these commands
nix-channel --add https://nixos.org/channels/nixos-20.03 nixos
nix-channel --add https://nixos.org/channels/nixos-20.03 nixpkgs
nix-channel --update
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment