Simplify quick start section

This commit is contained in:
Eelco Dolstra 2014-04-08 16:28:39 +02:00
parent d23931f3a4
commit e0a947cde6

View file

@ -11,56 +11,22 @@ to the following chapters.</para>
<orderedlist> <orderedlist>
<listitem><para>Download a source tarball or RPM or Debian/Ubuntu <listitem><para>Install Nix by running the following:
package from <link xlink:href='http://nixos.org/'/>. Build source
distributions using the regular sequence:
<screen> <screen>
$ tar xvfj nix-<replaceable>version</replaceable>.tar.bz2 $ bash &lt;(curl https://nixos.org/nix/install)
$ cd nix-<replaceable>version</replaceable> </screen>
$ ./configure
$ make
$ make install <lineannotation>(as root)</lineannotation></screen>
This will install the Nix binaries in <filename>/usr/local</filename> This will install Nix in <filename>/nix</filename>. The install script
and keep the Nix store and other state in <filename>/nix</filename>. will create <filename>/nix</filename> using <command>sudo</command>,
You can change the former by specifying so make sure you have sufficient rights. (For other installation
<option>--prefix=<replaceable>path</replaceable></option>. The methods, see <xref linkend="chap-installation"/>.)</para></listitem>
location of the store can be changed using
<option>--with-store-dir=<replaceable>path</replaceable></option>.
However, you shouldn't change the store location, if at all possible,
since that will make it impossible to use pre-built binaries from the
Nixpkgs channel and other channels. The location of the state can be
changed using
<option>--localstatedir=<replaceable>path</replaceable>.</option></para></listitem>
<listitem><para>You should add
<filename><replaceable>prefix</replaceable>/etc/profile.d/nix.sh</filename>
to your <filename>~/.profile</filename> (or some other login
file).</para></listitem>
<listitem><para>Subscribe to the Nix Packages channel.
<screen>
$ nix-channel --add http://nixos.org/channels/nixpkgs-unstable</screen>
</para></listitem>
<listitem><para>Download the latest Nix expressions available in the channel.
<screen>
$ nix-channel --update</screen>
Note that this in itself doesn't download any packages, it just
downloads the Nix expressions that build them and stores them
somewhere (under <filename>~/.nix-defexpr</filename>, in case you're
curious). Also, it registers the fact that pre-built binaries are
available remotely.</para></listitem>
<listitem><para>See what installable packages are currently available <listitem><para>See what installable packages are currently available
in the channel: in the channel:
<screen> <screen>
$ nix-env -qa \* $ nix-env -qa
docbook-xml-4.2 docbook-xml-4.2
firefox-1.0pre-PR-0.10.1 firefox-1.0pre-PR-0.10.1
hello-2.1.1 hello-2.1.1
@ -72,7 +38,7 @@ libxslt-1.1.0
<listitem><para>Install some packages from the channel: <listitem><para>Install some packages from the channel:
<screen> <screen>
$ nix-env -i hello firefox <replaceable>...</replaceable> </screen> $ nix-env -i hello <replaceable>...</replaceable> </screen>
This should download pre-built packages; it should not build them This should download pre-built packages; it should not build them
locally (if it does, something went wrong).</para></listitem> locally (if it does, something went wrong).</para></listitem>
@ -84,8 +50,7 @@ $ which hello
/home/eelco/.nix-profile/bin/hello /home/eelco/.nix-profile/bin/hello
$ hello $ hello
Hello, world! Hello, world!
$ firefox </screen>
<lineannotation>(read Slashdot or something)</lineannotation></screen>
</para></listitem> </para></listitem>
@ -99,7 +64,7 @@ $ nix-env -e hello</screen>
<listitem><para>To keep up-to-date with the channel, do: <listitem><para>To keep up-to-date with the channel, do:
<screen> <screen>
$ nix-channel --update $ nix-channel --update nixpkgs
$ nix-env -u '*'</screen> $ nix-env -u '*'</screen>
The latter command will upgrade each installed package for which there The latter command will upgrade each installed package for which there