Multi-user installation (recommended)
Install Nix via the recommended multi-user installation:
$ sh <(curl --proto '=https' --tlsv1.2 -L https://nixos.org/nix/install) --daemon
We recommend the multi-user install if you are on Linux running systemd, with SELinux disabled and you can authenticate with sudo.
Single-user installation
Install Nix via the single-user installation:
$ sh <(curl --proto '=https' --tlsv1.2 -L https://nixos.org/nix/install) --no-daemon
Above command will perform a single-user installation of Nix, meaning that nix is owned by the invoking user. You should run this under your usual user account, not as root. The script will invoke sudo to create /nix if it doesn’t already exist.
Which type of installation should you choose?
This depends on your requirements, but here is a short list of reasons why we recommend multi-user installation:
Pros
- Better build isolation (and that is what Nix is all about)
- Better security (a build can not write somewhere in your home)
- Sharing builds between users
Cons
- Requires
rootto run the daemon - More involved installation (creation of
nixbld* users, installing a systemd unit, … - Harder to uninstall