2006-08-21 18:05:11 +02:00
|
|
|
<?xml version="1.0" encoding="utf-8"?>
|
|
|
|
<chapter xmlns="http://docbook.org/ns/docbook"
|
|
|
|
xmlns:xlink="http://www.w3.org/1999/xlink"
|
|
|
|
xml:id="chap-installation">
|
2003-08-13 11:13:52 +02:00
|
|
|
|
2006-08-21 18:05:11 +02:00
|
|
|
<title>Installation</title>
|
2003-08-13 11:13:52 +02:00
|
|
|
|
|
|
|
|
2006-08-21 18:05:11 +02:00
|
|
|
<section><info><title>Obtaining Nix</title></info>
|
|
|
|
|
2006-09-29 12:31:56 +02:00
|
|
|
<para>The easiest way to obtain Nix is to download a <link
|
|
|
|
xlink:href="http://www.cs.uu.nl/groups/ST/Trace/Nix">source
|
|
|
|
distribution</link>. RPMs for Red Hat, SuSE, and Fedora Core are also
|
|
|
|
available.</para>
|
2004-10-14 13:54:41 +02:00
|
|
|
|
|
|
|
<para>Alternatively, the most recent sources of Nix can be obtained
|
2006-08-21 18:05:11 +02:00
|
|
|
from its <link
|
|
|
|
xlink:href="https://svn.cs.uu.nl:12443/repos/trace/nix/trunk">Subversion
|
|
|
|
repository</link>. For example, the following command will check out
|
|
|
|
the latest revision into a directory called
|
|
|
|
<filename>nix</filename>:</para>
|
2003-08-13 11:13:52 +02:00
|
|
|
|
2004-10-14 13:54:41 +02:00
|
|
|
<screen>
|
2003-11-26 13:30:16 +01:00
|
|
|
$ svn checkout https://svn.cs.uu.nl:12443/repos/trace/nix/trunk nix</screen>
|
2003-08-13 11:13:52 +02:00
|
|
|
|
2006-08-21 18:05:11 +02:00
|
|
|
<para>Likewise, specific releases can be obtained from the <link
|
|
|
|
xlink:href="https://svn.cs.uu.nl:12443/repos/trace/nix/tags">tags
|
|
|
|
directory</link> of the repository. If you don't have Subversion, you
|
|
|
|
can also download an automatically generated <link
|
|
|
|
xlink:href="https://svn.cs.uu.nl:12443/dist/trace/">compressed
|
|
|
|
tar-file</link> of the head revision of the trunk.</para>
|
2003-11-26 13:30:16 +01:00
|
|
|
|
2006-08-21 18:05:11 +02:00
|
|
|
</section>
|
2003-11-26 13:30:16 +01:00
|
|
|
|
|
|
|
|
2006-08-21 18:05:11 +02:00
|
|
|
<section><info><title>Prerequisites</title></info>
|
2004-01-20 12:49:32 +01:00
|
|
|
|
2006-09-29 12:31:56 +02:00
|
|
|
<para><emphasis>The following prerequisites only apply when you build
|
|
|
|
from source</emphasis>. Binary releases (e.g., RPMs) have no
|
|
|
|
prerequisites.</para>
|
2003-11-26 13:30:16 +01:00
|
|
|
|
2004-10-14 13:54:41 +02:00
|
|
|
<para>A fairly recent version of GCC/G++ is required. Version 2.95
|
|
|
|
and higher should work.</para>
|
2003-08-13 11:13:52 +02:00
|
|
|
|
2004-10-14 13:54:41 +02:00
|
|
|
<para>To build this manual and the man-pages you need the
|
|
|
|
<command>xmllint</command> and <command>xsltproc</command> programs,
|
|
|
|
which are part of the <literal>libxml2</literal> and
|
|
|
|
<literal>libxslt</literal> packages, respectively. You also need the
|
2006-08-21 18:05:11 +02:00
|
|
|
<link
|
|
|
|
xlink:href="http://docbook.sourceforge.net/projects/xsl/">DocBook XSL
|
|
|
|
stylesheets</link> and optionally the <link
|
2006-09-29 12:31:56 +02:00
|
|
|
xlink:href="http://www.docbook.org/schemas/5x"> DocBook 5.0 RELAX NG
|
|
|
|
schemas</link>. Note that these are only required if you modify the
|
|
|
|
manual sources or when you are building from the Subversion
|
2004-10-14 13:54:41 +02:00
|
|
|
repository.</para>
|
|
|
|
|
|
|
|
<para>To build the parser, very <emphasis>recent</emphasis> 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 <emphasis>not</emphasis> work),
|
2006-08-21 18:05:11 +02:00
|
|
|
which can be obtained from the <link
|
|
|
|
xlink:href="ftp://alpha.gnu.org/pub/gnu/bison">GNU FTP server</link>.
|
|
|
|
For Flex, you need version 2.5.31, which is available on <link
|
|
|
|
xlink:href="http://lex.sourceforge.net/">SourceForge</link>. Slightly
|
|
|
|
older versions may also work, but ancient versions like the ubiquitous
|
2004-10-14 13:54:41 +02:00
|
|
|
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.</para>
|
|
|
|
|
|
|
|
<para>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 <filename>externals/</filename> directory. See
|
|
|
|
<filename>externals/Makefile.am</filename> for the precise URLs of
|
2004-10-31 18:08:48 +01:00
|
|
|
these packages. Alternatively, if you already have them installed,
|
|
|
|
you can use <command>configure</command>'s <option>--with-bdb</option>
|
|
|
|
and <option>--with-aterm</option> options to point to their respective
|
|
|
|
locations. Note that Berkeley DB <emphasis>must</emphasis> be version
|
2005-12-25 00:22:05 +01:00
|
|
|
4.4; other versions may not have compatible database formats.</para>
|
2004-10-14 13:54:41 +02:00
|
|
|
|
2006-08-21 18:05:11 +02:00
|
|
|
</section>
|
2004-01-30 17:32:14 +01:00
|
|
|
|
2003-08-13 11:13:52 +02:00
|
|
|
|
2006-08-21 18:05:11 +02:00
|
|
|
<section><info><title>Building Nix from source</title></info>
|
2003-08-13 11:13:52 +02:00
|
|
|
|
2004-10-14 13:54:41 +02:00
|
|
|
<para>After unpacking or checking out the Nix sources, issue the
|
|
|
|
following commands:
|
2003-08-13 11:13:52 +02:00
|
|
|
</para>
|
|
|
|
|
2004-10-14 13:54:41 +02:00
|
|
|
<screen>
|
2003-08-13 17:17:57 +02:00
|
|
|
$ ./configure <replaceable>options...</replaceable>
|
|
|
|
$ make
|
|
|
|
$ make install</screen>
|
2003-08-13 11:13:52 +02:00
|
|
|
|
2004-10-14 13:54:41 +02:00
|
|
|
<para>When building from the Subversion repository, these should be
|
|
|
|
preceded by the command:
|
2003-11-26 13:30:16 +01:00
|
|
|
</para>
|
|
|
|
|
2004-10-14 13:54:41 +02:00
|
|
|
<screen>
|
2003-11-26 13:30:16 +01:00
|
|
|
$ autoreconf -i</screen>
|
|
|
|
|
2004-10-14 13:54:41 +02:00
|
|
|
<para>The installation path can be specified by passing the
|
|
|
|
<option>--prefix=<replaceable>prefix</replaceable></option> to
|
|
|
|
<command>configure</command>. The default installation directory is
|
|
|
|
<filename>/nix</filename>. You can change this to any location you
|
|
|
|
like. You must have write permission to the
|
2004-10-31 18:08:48 +01:00
|
|
|
<replaceable>prefix</replaceable> path.</para>
|
2003-08-13 11:13:52 +02:00
|
|
|
|
2006-09-29 12:31:56 +02:00
|
|
|
<warning><para>It is best <emphasis>not</emphasis> to change the
|
|
|
|
installation prefix from its default, since doing so makes it
|
|
|
|
impossible to use pre-built binaries from the standard Nixpkgs
|
|
|
|
channels.</para></warning>
|
2003-11-26 13:30:16 +01:00
|
|
|
|
2004-10-14 13:54:41 +02:00
|
|
|
<para>If you want to rebuilt the documentation, pass the full path to
|
2006-09-29 12:31:56 +02:00
|
|
|
the DocBook RELAX NG schemas and to the DocBook XSL stylesheets using
|
|
|
|
the
|
|
|
|
<option>--with-docbook-rng=<replaceable>path</replaceable></option>
|
2004-10-14 13:54:41 +02:00
|
|
|
and
|
|
|
|
<option>--with-docbook-xsl=<replaceable>path</replaceable></option>
|
|
|
|
options.</para>
|
2003-08-13 11:13:52 +02:00
|
|
|
|
2006-08-21 18:05:11 +02:00
|
|
|
</section>
|
2003-11-26 15:25:39 +01:00
|
|
|
|
2004-01-20 12:49:32 +01:00
|
|
|
|
2006-08-21 18:05:11 +02:00
|
|
|
<section><info><title>Installing from RPMs</title></info>
|
2004-01-20 12:49:32 +01:00
|
|
|
|
2006-08-21 18:05:11 +02:00
|
|
|
<para>RPM packages of Nix can be downloaded from <uri
|
|
|
|
xlink:href="http://www.cs.uu.nl/groups/ST/Trace/Nix">http://www.cs.uu.nl/groups/ST/Trace/Nix</uri>.
|
|
|
|
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 <literal>glibc</literal> 2.3 or later.</para>
|
2004-01-20 12:49:32 +01:00
|
|
|
|
2004-10-14 13:54:41 +02:00
|
|
|
<para>Once downloaded, the RPMs can be installed or upgraded using
|
|
|
|
<command>rpm -U</command>. For example,</para>
|
|
|
|
|
|
|
|
<screen>
|
2004-10-31 18:08:48 +01:00
|
|
|
$ rpm -U nix-0.5pre664-1.i386.rpm</screen>
|
2004-01-20 12:49:32 +01:00
|
|
|
|
2004-10-14 13:54:41 +02:00
|
|
|
<para>The RPMs install into the directory <filename>/nix</filename>.
|
|
|
|
Nix can be uninstalled using <command>rpm -e nix</command>. After
|
|
|
|
this it will be necessary to manually remove the Nix store and other
|
|
|
|
auxiliary data:</para>
|
2004-01-20 12:49:32 +01:00
|
|
|
|
2004-10-14 13:54:41 +02:00
|
|
|
<screen>
|
2004-10-31 18:08:48 +01:00
|
|
|
$ rm -rf /nix/store
|
|
|
|
$ rm -rf /nix/var</screen>
|
2004-01-20 12:49:32 +01:00
|
|
|
|
2006-08-21 18:05:11 +02:00
|
|
|
</section>
|
2004-01-20 12:49:32 +01:00
|
|
|
|
|
|
|
|
2006-09-29 13:03:16 +02:00
|
|
|
<section><info><title>Upgrading Nix through Nix</title></info>
|
|
|
|
|
|
|
|
<para>You can install the latest stable version of Nix through Nix
|
|
|
|
itself by subscribing to the channel <link
|
|
|
|
xlink:href="http://nix.cs.uu.nl/dist/nix/channels-v3/nix-stable" /> ,
|
|
|
|
or the latest unstable version by subscribing to the channel<link
|
|
|
|
xlink:href="http://nix.cs.uu.nl/dist/nix/channels-v3/nix-unstable" />.
|
|
|
|
You can also do a <link linkend="sec-one-click">one-click
|
|
|
|
installation</link> by clicking on the package links at <link
|
|
|
|
xlink:href="http://nix.cs.uu.nl/dist/nix/" />.</para>
|
|
|
|
|
|
|
|
</section>
|
|
|
|
|
|
|
|
|
2006-08-21 18:05:11 +02:00
|
|
|
<section><info><title>Permissions</title></info>
|
2004-10-14 13:54:41 +02:00
|
|
|
|
|
|
|
<para>All Nix operations must be performed under the user ID that owns
|
|
|
|
the Nix store and database
|
|
|
|
(<filename><replaceable>prefix</replaceable>/store</filename> and
|
|
|
|
<filename><replaceable>prefix</replaceable>/var/nix/db</filename>,
|
|
|
|
respectively). When installed from the RPM packages, these
|
2006-08-21 18:05:11 +02:00
|
|
|
directories are owned by <systemitem class="username">root</systemitem>.</para>
|
2004-10-14 13:54:41 +02:00
|
|
|
|
2006-08-21 18:05:11 +02:00
|
|
|
<section><info><title>Setuid installation</title></info>
|
2004-10-31 18:08:48 +01:00
|
|
|
|
|
|
|
<para>As a somewhat <emphasis>ad hoc</emphasis> hack, you can also
|
|
|
|
install the Nix binaries <quote>setuid</quote> so that a Nix store can
|
|
|
|
be shared among several users. To do this, configure Nix with the
|
|
|
|
<emphasis>--enable-setuid</emphasis> option. Nix will be installed as
|
|
|
|
owned by a user and group specified by the
|
2006-08-21 18:05:11 +02:00
|
|
|
<option>--with-nix-user=</option><parameter>user</parameter> and
|
|
|
|
<option>--with-nix-group=</option><parameter>group</parameter>
|
2004-10-31 18:08:48 +01:00
|
|
|
options. E.g.,
|
|
|
|
|
|
|
|
<screen>
|
|
|
|
$ ./configure --enable-setuid --with-nix-user=my_nix_user --with-nix-group=my_nix_group</screen>
|
|
|
|
|
|
|
|
The user and group default to <literal>nix</literal>. You should make
|
|
|
|
sure that both the user and the group exist. Any <quote>real</quote>
|
|
|
|
users that you want to allow access should be added to the Nix
|
|
|
|
group.</para>
|
|
|
|
|
|
|
|
<warning><para>A setuid installation should only by used if the users
|
|
|
|
in the Nix group are mutually trusted, since any user in that group
|
|
|
|
has the ability to change anything in the Nix store or database. For
|
|
|
|
instance, they could install a trojan horse in executables used by
|
|
|
|
other users.</para></warning>
|
|
|
|
|
|
|
|
<warning><para>On some platforms, the Nix binaries will be installed
|
|
|
|
as setuid <literal>root</literal>. They drop root privileges
|
|
|
|
immediately after startup and switch to the Nix user. The reason for
|
|
|
|
this is that both the real and effective user must be set to the Nix
|
|
|
|
user, and POSIX has no system call to do this. This is not the case
|
|
|
|
on systems that have the <function>setresuid()</function> system call
|
|
|
|
(such as Linux and FreeBSD), so on those systems the binaries are
|
|
|
|
simply owned by the Nix user.</para></warning>
|
|
|
|
|
2006-08-21 18:05:11 +02:00
|
|
|
</section>
|
2004-10-31 18:08:48 +01:00
|
|
|
|
2006-08-21 18:05:11 +02:00
|
|
|
</section>
|
2004-01-20 12:49:32 +01:00
|
|
|
|
2003-11-26 15:25:39 +01:00
|
|
|
|
2006-08-21 18:05:11 +02:00
|
|
|
<section><info><title>Using Nix</title></info>
|
2004-10-14 13:54:41 +02:00
|
|
|
|
|
|
|
<para>To use Nix, some environment variables should be set. In
|
|
|
|
particular, <envar>PATH</envar> should contain the directories
|
|
|
|
<filename><replaceable>prefix</replaceable>/bin</filename> and
|
|
|
|
<filename>~/.nix-profile/bin</filename>. The first directory contains
|
|
|
|
the Nix tools themselves, while <filename>~/.nix-profile</filename> is
|
|
|
|
a symbolic link to the current <emphasis>user environment</emphasis>
|
|
|
|
(an automatically generated package consisting of symlinks to
|
|
|
|
installed packages). The simplest way to set the required environment
|
|
|
|
variables is to include the file
|
|
|
|
<filename><replaceable>prefix</replaceable>/etc/profile.d/nix.sh</filename>
|
|
|
|
in your <filename>~/.bashrc</filename> (or similar), like this:</para>
|
|
|
|
|
|
|
|
<screen>
|
2004-11-01 13:02:44 +01:00
|
|
|
source <replaceable>prefix</replaceable>/etc/profile.d/nix.sh</screen>
|
2003-11-26 15:25:39 +01:00
|
|
|
|
2006-08-21 18:05:11 +02:00
|
|
|
</section>
|
2004-10-14 13:54:41 +02:00
|
|
|
|
2003-11-26 15:25:39 +01:00
|
|
|
|
2003-08-13 11:13:52 +02:00
|
|
|
</chapter>
|