Installation Obtaining Nix The easiest way to obtain Nix is to download a source distribution. RPMs for SuSE and Red Hat are also available. These distributions are generated automatically. Alternatively, the most recent sources of Nix can be obtained from its Subversion repository. For example, the following command will check out the latest revision into a directory called nix: $ svn checkout https://svn.cs.uu.nl:12443/repos/trace/nix/trunk nix Likewise, specific releases can be obtained from the tags directory of the repository. If you don't have Subversion, you can also download an automatically generated compressed tar-file of the head revision of the trunk. Prerequisites The following prerequisites only apply when you build from source. Binary releases (e.g., RPMs) have no prerequisites. A fairly recent version of GCC/G++ is required. Version 2.95 and higher should work. To build this manual and the man-pages you need the xmllint and xsltproc programs, which are part of the libxml2 and libxslt packages, respectively. You also need the DocBook XSL stylesheets and optionally the DocBook XML 4.2 DTD. Note that these are only required if you modify the manual sources or when you are building from the Subversion repository. To build the parser, very recent versions of Bison and Flex are required. (This is because Nix needs GLR support in Bison and reentrancy support in Flex.) For Bison, you need version 1.875c or higher (1.875 does not work), which can be obtained from the GNU FTP server. For Flex, you need version 2.5.31, which is available on SourceForge. Slightly older versions may also work, but ancient versions like the ubiquitous 2.5.4a won't. Note that these are only required if you modify the parser or when you are building from the Subversion repository. Nix uses Sleepycat's Berkeley DB and CWI's ATerm library. These are included in the Nix source distribution. If you build from the Subversion repository, you must download them yourself and place them in the externals/ directory. See externals/Makefile.am for the precise URLs of these packages. Building Nix from source After unpacking or checking out the Nix sources, issue the following commands: $ ./configure options... $ make $ make install When building from the Subversion repository, these should be preceded by the command: $ autoreconf -i The installation path can be specified by passing the to configure. The default installation directory is /nix. You can change this to any location you like. You must have write permission to the prefix path. It is advisable not to change the installation prefix from its default, since doing so will in all likelihood make it impossible to use derivations built on other systems. If you want to rebuilt the documentation, pass the full path to the DocBook XML catalog file (docbook.cat) and to the DocBook XSL stylesheets using the and options. Installing from RPMs RPM packages of Nix can be downloaded from . These RPMs should work for most fairly recent releases of SuSE and Red Hat Linux. They have been known to work work on SuSE Linux 8.1 and 9.0, and Red Hat 9.0. In fact, it should work on any RPM-based Linux distribution based on glibc 2.3 or later. Once downloaded, the RPMs can be installed or upgraded using rpm -U. For example, rpm -U nix-0.5pre664-1.i386.rpm The RPMs install into the directory /nix. Nix can be uninstalled using rpm -e nix. After this it will be necessary to manually remove the Nix store and other auxiliary data: rm -rf /nix/store rm -rf /nix/var Permissions All Nix operations must be performed under the user ID that owns the Nix store and database (prefix/store and prefix/var/nix/db, respectively). When installed from the RPM packages, these directories are owned by root. Using Nix To use Nix, some environment variables should be set. In particular, PATH should contain the directories prefix/bin and ~/.nix-userenv/bin. The first directory contains the Nix tools themselves, while ~/.nix-userenv is a symbolic link to the current user environment (an automatically generated package consisting of symlinks to installed packages). The simplest way to set the required environment variables is to include the file prefix/etc/profile.d/nix.sh in your ~/.bashrc (or similar), like this: . prefix/etc/profile.d/nix.sh