Skip to content

InstallNix

Compl Yue edited this page Nov 20, 2019 · 6 revisions

Nix Installation Suggestions

If you haven't installed Nix and are just about to, here's the suggestion:

The default Nix install script will sudo create the folder /nix then chown to your os account, this is the store Nix will populate all source/binary payloads into, be noted that the folder /nix will easily go 30+ GB as your go with your daily development.

So if you have a tight root partition barely to hold all that large data, you'd better allocate a separate partition/volume and mount to /nix before actually run Nix's installation script.

I do allocate one in APFS like this:

NixPartitionInDiskUtils

and sudo create /nix, have it mounted automatically by sudo vifs then add a line like:

LABEL=Nix /nix apfs rw,noatime

then sudo mount /nix followed by df -h /nix to verify the mountpoint & capacity works as expected.

And for Linux it's better done by adding an LVM.

After done that, or not if you are not worrying about your root partition, go https://nixos.org/nix/download.html and use the one-liner installer there.

Clone this wiki locally