2006-08-21 16:05:11 +00:00
|
|
|
|
<chapter xmlns="http://docbook.org/ns/docbook"
|
|
|
|
|
xmlns:xlink="http://www.w3.org/1999/xlink">
|
|
|
|
|
|
|
|
|
|
<title>Quick Start</title>
|
|
|
|
|
|
2004-10-13 15:35:47 +00:00
|
|
|
|
|
|
|
|
|
<para>This chapter is for impatient people who don't like reading
|
|
|
|
|
documentation. For more in-depth information you are kindly referred
|
2004-10-14 11:55:12 +00:00
|
|
|
|
to the following chapters.</para>
|
2004-10-13 15:35:47 +00:00
|
|
|
|
|
|
|
|
|
<orderedlist>
|
|
|
|
|
|
2006-08-21 16:05:11 +00:00
|
|
|
|
<listitem><para>Download a source tarball or RPM from <link
|
|
|
|
|
xlink:href='http://www.cs.uu.nl/groups/ST/Trace/Nix'/>. Build source
|
2004-10-13 15:35:47 +00:00
|
|
|
|
distributions using the regular sequence:
|
2004-01-20 15:37:55 +00:00
|
|
|
|
|
2004-10-13 15:35:47 +00:00
|
|
|
|
<screen>
|
2004-01-20 15:37:55 +00:00
|
|
|
|
$ tar xvfj nix-<replaceable>version</replaceable>.tar.bz2
|
|
|
|
|
$ ./configure
|
|
|
|
|
$ make
|
|
|
|
|
$ make install <lineannotation>(as root)</lineannotation></screen>
|
|
|
|
|
|
2004-10-13 15:35:47 +00:00
|
|
|
|
This will install Nix in <filename>/nix</filename>. You shouldn't
|
|
|
|
|
change the prefix if at all possible since that will make it
|
|
|
|
|
impossible to use our pre-built components. Alternatively, you could
|
|
|
|
|
grab an RPM if you're on an RPM-based system. You should also add
|
|
|
|
|
<filename>/nix/etc/profile.d/nix.sh</filename> to your
|
|
|
|
|
<filename>~/.bashrc</filename> (or some other login
|
|
|
|
|
file).</para></listitem>
|
2004-01-20 15:37:55 +00:00
|
|
|
|
|
2004-10-13 15:35:47 +00:00
|
|
|
|
<listitem><para>Subscribe to the Nix Packages channel.
|
|
|
|
|
|
|
|
|
|
<screen>
|
2006-09-28 09:10:53 +00:00
|
|
|
|
$ nix-channel --add \
|
|
|
|
|
http://nix.cs.uu.nl/dist/nix/channels-v3/nixpkgs-unstable</screen>
|
2004-10-13 15:35:47 +00:00
|
|
|
|
|
|
|
|
|
</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 components, 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 components are currently
|
|
|
|
|
available in the channel:
|
|
|
|
|
|
|
|
|
|
<screen>
|
2006-09-28 09:10:53 +00:00
|
|
|
|
$ nix-env -qa ’*’ <lineannotation>(mind the quotes!)</lineannotation>
|
2004-01-20 15:37:55 +00:00
|
|
|
|
docbook-xml-4.2
|
2004-10-13 15:35:47 +00:00
|
|
|
|
firefox-1.0pre-PR-0.10.1
|
|
|
|
|
hello-2.1.1
|
2004-01-20 15:37:55 +00:00
|
|
|
|
libxslt-1.1.0
|
|
|
|
|
<replaceable>...</replaceable></screen>
|
|
|
|
|
|
2004-10-13 15:35:47 +00:00
|
|
|
|
</para></listitem>
|
2004-01-20 15:37:55 +00:00
|
|
|
|
|
2004-10-13 15:35:47 +00:00
|
|
|
|
<listitem><para>Install some components from the channel:
|
2004-01-20 15:37:55 +00:00
|
|
|
|
|
2004-10-13 15:35:47 +00:00
|
|
|
|
<screen>
|
|
|
|
|
$ nix-env -i hello firefox <replaceable>...</replaceable> </screen>
|
2004-01-20 15:37:55 +00:00
|
|
|
|
|
2004-10-13 15:35:47 +00:00
|
|
|
|
This should download the pre-built components; it should not build
|
|
|
|
|
them locally (if it does, something went wrong).</para></listitem>
|
2004-01-20 15:37:55 +00:00
|
|
|
|
|
2004-10-13 15:35:47 +00:00
|
|
|
|
<listitem><para>Test that they work:
|
2004-01-20 15:37:55 +00:00
|
|
|
|
|
2004-10-13 15:35:47 +00:00
|
|
|
|
<screen>
|
2004-01-20 15:37:55 +00:00
|
|
|
|
$ which hello
|
2004-02-06 10:30:20 +00:00
|
|
|
|
/home/eelco/.nix-profile/bin/hello
|
2004-01-20 15:37:55 +00:00
|
|
|
|
$ hello
|
|
|
|
|
Hello, world!
|
2004-10-13 15:35:47 +00:00
|
|
|
|
$ firefox
|
2004-01-20 15:37:55 +00:00
|
|
|
|
<lineannotation>(read Slashdot or something)</lineannotation></screen>
|
|
|
|
|
|
2004-10-13 15:35:47 +00:00
|
|
|
|
</para></listitem>
|
2004-01-20 15:37:55 +00:00
|
|
|
|
|
2004-10-13 15:35:47 +00:00
|
|
|
|
<listitem><para>Uninstall a package:
|
2004-01-20 15:37:55 +00:00
|
|
|
|
|
2004-10-13 15:35:47 +00:00
|
|
|
|
<screen>
|
2004-01-20 15:37:55 +00:00
|
|
|
|
$ nix-env -e hello</screen>
|
|
|
|
|
|
2004-10-13 15:35:47 +00:00
|
|
|
|
</para></listitem>
|
|
|
|
|
|
|
|
|
|
<listitem><para>To keep up-to-date with the channel, do:
|
|
|
|
|
|
|
|
|
|
<screen>
|
|
|
|
|
$ nix-channel --update
|
|
|
|
|
$ nix-env -u '*'</screen>
|
|
|
|
|
|
|
|
|
|
The latter command will upgrade each installed component for which
|
2005-04-08 13:00:38 +00:00
|
|
|
|
there is a “newer” version (as determined by comparing the version
|
|
|
|
|
numbers).</para></listitem>
|
2004-01-20 15:37:55 +00:00
|
|
|
|
|
2006-09-29 11:03:16 +00:00
|
|
|
|
<listitem><para>You can also install specific packages directly from
|
|
|
|
|
your web browser. For instance, you can go to <link
|
|
|
|
|
xlink:href="http://nix.cs.uu.nl/dist/nix/nixpkgs-unstable-latest/" />
|
|
|
|
|
and click on any link for the individual packages for your platform.
|
|
|
|
|
Associate <literal>application/nix-package</literal> with the program
|
|
|
|
|
<filename>/nix/bin/nix-install-package</filename>. A window should
|
|
|
|
|
appear asking you whether it’s okay to install the package. Say
|
|
|
|
|
<literal>Y</literal>. The package and all its dependencies will be
|
|
|
|
|
installed.</para></listitem>
|
|
|
|
|
|
2004-10-13 15:35:47 +00:00
|
|
|
|
<listitem><para>If you're unhappy with the result of a
|
|
|
|
|
<command>nix-env</command> action (e.g., an upgraded component turned
|
|
|
|
|
out not to work properly), you can go back:
|
2004-01-20 15:37:55 +00:00
|
|
|
|
|
2004-10-13 15:35:47 +00:00
|
|
|
|
<screen>
|
|
|
|
|
$ nix-env --rollback</screen>
|
2004-01-20 15:37:55 +00:00
|
|
|
|
|
2004-10-13 15:35:47 +00:00
|
|
|
|
</para></listitem>
|
2004-01-20 15:37:55 +00:00
|
|
|
|
|
2004-10-13 15:35:47 +00:00
|
|
|
|
<listitem><para>You should periodically run the Nix garbage collector
|
|
|
|
|
to get rid of unused packages, since uninstalls or upgrades don't
|
2004-11-14 00:24:57 +00:00
|
|
|
|
actually delete them:
|
2004-01-20 15:37:55 +00:00
|
|
|
|
|
2004-10-13 15:35:47 +00:00
|
|
|
|
<screen>
|
2006-09-28 09:10:53 +00:00
|
|
|
|
$ nix-collect-garbage -d</screen>
|
2004-01-20 15:37:55 +00:00
|
|
|
|
|
2006-09-28 09:10:53 +00:00
|
|
|
|
<!--
|
2005-04-08 13:00:38 +00:00
|
|
|
|
The first command deletes old “generations” of your profile (making
|
|
|
|
|
rollbacks impossible, but also making the components in those old
|
|
|
|
|
generations available for garbage collection), while the second
|
2006-09-28 09:10:53 +00:00
|
|
|
|
command actually deletes them.-->
|
|
|
|
|
|
|
|
|
|
</para></listitem>
|
2004-01-20 15:37:55 +00:00
|
|
|
|
|
2004-10-13 15:35:47 +00:00
|
|
|
|
</orderedlist>
|
2004-01-20 15:37:55 +00:00
|
|
|
|
|
2004-11-14 00:24:57 +00:00
|
|
|
|
</chapter>
|