Nix - ArchWiki

# Nix

From ArchWiki
Jump to navigation Jump to search

Nix is a purely functional package manager that aims to make package management reliable and reproducible.

See the Nix Package Manager Guide for more information.

## Installation

Nix is available in the AUR as nixAUR.

Nix is installed by default in the `/nix` folder.

## Installation using archlinux-nix

archlinux-nixAUR can be used to 'bootstrap' an Arch Linux compatible Nix system by setting up the required groups and permissions.

After installing nixAUR, which should install archlinux-nixAUR, list the available commands:

    $ archlinux-nix

To setup build groups:

    # archlinux-nix setup-build-group

To bootstrap the system:

    # archlinux-nix bootstrap

## Configuration

If using Nix with an unprivileged account is desired, run:

    # chown -R $USER: /nix/var/nix/{gcroots,profiles}

In order to use Nix for the first time, add an update channel:

    $ nix-channel --add https://nixos.org/channels/nixpkgs-unstable
    $ nix-channel --update
    $ nix-env -u

If only using unprivileged Nix access, run to silence "warning: Nix search path entry '...' does not exist":

    # nix-channel --update

Makes Nix's daemon (and package manager) functional without rebooting; only applies to the terminal this is ran from (until reboot):

    $ source /etc/profile.d/nix{,-daemon}.sh

Category:

- Package management