about summary refs log tree commit diff
path: root/doc/manual/quick-start.xml
blob: e12b28da25bba64a77ea493032839a84802cc8d1 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
<chapter><title>Quick Start</title>

<para>This chapter is for impatient people who don't like reading
documentation.  For more in-depth information you are kindly referred
to the following chapters.</para>

<orderedlist>

<listitem><para>Download a source tarball or RPM from <ulink
url='http://www.cs.uu.nl/groups/ST/Trace/Nix'/>.  Build source
distributions using the regular sequence:
        
<screen>
$ tar xvfj nix-<replaceable>version</replaceable>.tar.bz2
$ ./configure
$ make
$ make install <lineannotation>(as root)</lineannotation></screen>

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>

<listitem><para>Subscribe to the Nix Packages channel.

<screen>
$ nix-channel --add http://catamaran.labs.cs.uu.nl/dist/nix/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 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>
$ nix-env -qa
docbook-xml-4.2
firefox-1.0pre-PR-0.10.1
hello-2.1.1
libxslt-1.1.0
<replaceable>...</replaceable></screen>

</para></listitem>

<listitem><para>Install some components from the channel:
        
<screen>
$ nix-env -i hello firefox <replaceable>...</replaceable> </screen>

This should download the pre-built components; it should not build
them locally (if it does, something went wrong).</para></listitem>

<listitem><para>Test that they work:

<screen>
$ which hello
/home/eelco/.nix-profile/bin/hello
$ hello
Hello, world!
$ firefox
<lineannotation>(read Slashdot or something)</lineannotation></screen>

</para></listitem>
    
<listitem><para>Uninstall a package:

<screen>
$ nix-env -e hello</screen>

</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
there is a <quote>newer</quote> version (as determined by comparing
the version numbers).</para></listitem>

<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:

<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
actually delete them:

<screen>
$ nix-env --delete-generations old
$ nix-collect-garbage</screen>

The first command deletes old <quote>generations</quote> of your
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>

</chapter>