* Updated the quick start section. Use channels instead of

downloading Nix expressions and calling nix-pull.  This is so
  user-friendly that even a Mac user can do it! :-)
This commit is contained in:
Eelco Dolstra 2004-10-13 15:35:47 +00:00
parent 2b20701f78
commit 371c57d8a7

View file

@ -1,141 +1,119 @@
<chapter> <chapter><title>Quick Start</title>
<title>Quick Start</title>
<para> <para>This chapter is for impatient people who don't like reading
This chapter is for impatient people who don't like reading documentation. For more in-depth information you are kindly referred
documentation. For more in-depth information you are kindly to <xref linkend='chap-installation' /> and <xref
referred to <xref linkend='chap-installation' /> and <xref linkend='chap-overview' />.</para>
linkend='chap-overview' />.
</para>
<orderedlist> <orderedlist>
<listitem> <listitem><para>Download a source tarball or RPM from <ulink
<para> url='http://www.cs.uu.nl/groups/ST/Trace/Nix'/>. Build source
Download a source tarball or RPM from <ulink distributions using the regular sequence:
url='http://www.cs.uu.nl/groups/ST/Trace/Nix'/>.
Build source distributions using the regular sequence:
<screen> <screen>
$ tar xvfj nix-<replaceable>version</replaceable>.tar.bz2 $ tar xvfj nix-<replaceable>version</replaceable>.tar.bz2
$ ./configure $ ./configure
$ make $ make
$ make install <lineannotation>(as root)</lineannotation></screen> $ make install <lineannotation>(as root)</lineannotation></screen>
This will install Nix in <filename>/nix</filename>. You This will install Nix in <filename>/nix</filename>. You shouldn't
should also add <filename>/nix/etc/profile.d/nix.sh</filename> change the prefix if at all possible since that will make it
to your <filename>~/.bashrc</filename> (or some other login impossible to use our pre-built components. Alternatively, you could
file). grab an RPM if you're on an RPM-based system. You should also add
</para> <filename>/nix/etc/profile.d/nix.sh</filename> to your
</listitem> <filename>~/.bashrc</filename> (or some other login
file).</para></listitem>
<listitem> <listitem><para>Subscribe to the Nix Packages channel.
<para>
Get some Nix expressions for pre-built packages by downloading
the latest <literal>nixpkgs</literal> distribution (from the
same location), and unpack them.
<screen> <screen>
$ wget http://<replaceable>...</replaceable>/nix/nixpkgs-<replaceable>version</replaceable>/nixpkgs-<replaceable>version</replaceable>.tar.bz2 $ nix-channel --add http://catamaran.labs.cs.uu.nl/dist/nix/channels/nixpkgs-unstable</screen>
$ tar xfj nixpkgs-<replaceable>version</replaceable>.tar.bz2</screen>
This will unpack the distribution into a directory </para></listitem>
<filename>nixpkgs-<replaceable>version</replaceable>/</filename>.
</para>
</listitem>
<listitem> <listitem><para>Download the latest Nix expressions available in the channel.
<para> <screen>
Pull the Nix cache. This ensures that when you install $ nix-channel --update</screen>
packages they are downloaded in pre-built form from the
network, rather than built from source.
<screen> Note that this in itself doesn't download any components, it just
$ nix-pull http://<replaceable>...</replaceable>/nix/nixpkgs-<replaceable>version</replaceable>/MANIFEST</screen> 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>
</para> <listitem><para>See what installable components are currently
available in the channel:
<para> <screen>
Note that currently we only pre-build for Linux on x86 $ nix-env -qa
platforms.
</para>
</listitem>
<listitem>
<para>
See what's available:
<screen>
$ nix-env -qaf nixpkgs-<replaceable>version</replaceable>/
MozillaFirebird-0.7
hello-2.1.1
docbook-xml-4.2 docbook-xml-4.2
firefox-1.0pre-PR-0.10.1
hello-2.1.1
libxslt-1.1.0 libxslt-1.1.0
<replaceable>...</replaceable></screen> <replaceable>...</replaceable></screen>
</para> </para></listitem>
</listitem>
<listitem> <listitem><para>Install some components from the channel:
<para>
Install some packages:
<screen> <screen>
$ nix-env -iBf nixpkgs-<replaceable>version</replaceable>/ hello MozillaFirebird <replaceable>...</replaceable> </screen> $ nix-env -i hello firefox <replaceable>...</replaceable> </screen>
</para> This should download the pre-built components; it should not build
</listitem> them locally (if it does, something went wrong).</para></listitem>
<listitem> <listitem><para>Test that they work:
<para>
Test that they work:
<screen> <screen>
$ which hello $ which hello
/home/eelco/.nix-profile/bin/hello /home/eelco/.nix-profile/bin/hello
$ hello $ hello
Hello, world! Hello, world!
$ MozillaFirebird $ firefox
<lineannotation>(read Slashdot or something)</lineannotation></screen> <lineannotation>(read Slashdot or something)</lineannotation></screen>
</para> </para></listitem>
</listitem>
<listitem> <listitem><para>Uninstall a package:
<para>
Uninstall a package:
<screen> <screen>
$ nix-env -e hello</screen> $ nix-env -e hello</screen>
</para> </para></listitem>
</listitem>
<listitem> <listitem><para>To keep up-to-date with the channel, do:
<para>
If a new release of <literal>nixpkgs</literal> comes along,
you can upgrade all installed packages to the latest versions
by downloading and unpacking the new release and doing:
<screen> <screen>
$ nix-env -uBf nixpkgs-<replaceable>version</replaceable>/ '*'</screen> $ nix-channel --update
$ nix-env -u '*'</screen>
</para> The latter command will upgrade each installed component for which
</listitem> there is a <quote>newer</quote> version (as determined by comparing
the version numbers).</para></listitem>
<listitem> <listitem><para>If you're unhappy with the result of a
<para> <command>nix-env</command> action (e.g., an upgraded component turned
You should periodically run the Nix garbage collector to get out not to work properly), you can go back:
rid of unused packages, since uninstalls or upgrades don't
actual delete them:
<screen> <screen>
$ nix-env --rollback</screen>
</para></listitem>
<listitem><para>You should periodically run the Nix garbage collector
to get rid of unused packages, since uninstalls or upgrades don't
actual delete them:
<screen>
$ nix-env --delete-generations old
$ nix-collect-garbage</screen> $ nix-collect-garbage</screen>
</para> The first command deletes old <quote>generations</quote> of your
</listitem> profile (making rollbacks impossible, but also making the components
in those old generations available for garbage collection), while the
second command actually deletes them.</para></listitem>
</orderedlist> </orderedlist>
</chapter> </chapter>