Commit | Line | Data |
---|---|---|
568717fd LC |
1 | \input texinfo |
2 | @c -*-texinfo-*- | |
3 | ||
4 | @c %**start of header | |
5 | @setfilename guix.info | |
6 | @documentencoding UTF-8 | |
7 | @settitle Guix Reference Manual | |
8 | @c %**end of header | |
9 | ||
10 | @include version.texi | |
11 | ||
568717fd LC |
12 | @dircategory Development |
13 | @direntry | |
14 | * guix: (guix). Guix, the functional package manager. | |
15 | * guix-build: (guix)Invoking guix-build | |
16 | Building packages with Guix. | |
17 | @end direntry | |
568717fd LC |
18 | |
19 | @titlepage | |
20 | @title{Guix Reference Manual} | |
21 | @subtitle{Using the Guix Functional Package Manager} | |
22 | @author Ludovic Courtès | |
23 | ||
24 | @page | |
25 | @vskip 0pt plus 1filll | |
26 | Edition @value{EDITION} @* | |
27 | @value{UPDATED} @* | |
28 | ||
29 | Copyright @copyright{} 2012 Ludovic Court@`es | |
30 | ||
31 | @quotation | |
32 | Permission is granted to copy, distribute and/or modify this document | |
33 | under the terms of the GNU Free Documentation License, Version 1.3 or | |
34 | any later version published by the Free Software Foundation; with no | |
35 | Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. A | |
36 | copy of the license is included in the section entitled ``GNU Free | |
37 | Documentation License''. | |
38 | @end quotation | |
39 | @end titlepage | |
40 | ||
41 | @copying | |
42 | This manual documents Guix version @value{VERSION}. | |
43 | ||
44 | Copyright (C) 2012 Ludovic Courtès | |
45 | ||
46 | Permission is granted to copy, distribute and/or modify this document | |
47 | under the terms of the GNU Free Documentation License, Version 1.3 or | |
48 | any later version published by the Free Software Foundation; with no | |
49 | Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. A | |
50 | copy of the license is included in the section entitled ``GNU Free | |
51 | Documentation License.'' | |
52 | @end copying | |
53 | ||
54 | @contents | |
55 | ||
56 | @c ********************************************************************* | |
57 | @node Top | |
58 | @top Guix | |
59 | ||
60 | This document describes Guix version @value{VERSION}. | |
61 | ||
62 | @menu | |
63 | * Introduction:: What is Guix about? | |
64 | * Programming Interface:: Using Guix in Scheme. | |
65 | * Utilities:: Package management commands. | |
66 | ||
67 | * Acknowledgments:: Thanks! | |
68 | * GNU Free Documentation License:: The license of this manual. | |
69 | * Concept Index:: Concepts. | |
70 | * Function Index:: Functions. | |
71 | @end menu | |
72 | ||
73 | @c ********************************************************************* | |
74 | @node Introduction | |
75 | @chapter Introduction | |
76 | ||
77 | Guix is a functional package management tool. Package management | |
78 | consists in all the activities that relate to building packages from | |
79 | source, honoring the build-time and run-time dependencies on packages, | |
80 | installing packages in user environments, upgrading installed packages | |
81 | to new versions or rolling back to a previous set, removing unused | |
82 | software packages, etc. | |
83 | ||
84 | @cindex functional package management | |
85 | The term @dfn{functional} refers to a specific package management | |
86 | discipline. In Guix, the package build and installation process is seen | |
87 | as a function, in the mathematical sense: that function takes inputs, | |
88 | such as build scripts, a compiler, and libraries depended on, and | |
89 | returns the installed package. As a pure function, its result depends | |
90 | solely on its inputs---for instance, it cannot refer to software or | |
91 | scripts that were not explicitly passed as inputs. A build function | |
92 | always produces the same result when passed a given set of inputs. Last | |
93 | but not least, a build function cannot alter the system's environment in | |
94 | any way; for instance, it cannot create, modify, or delete files outside | |
95 | of its build and installation directories. This is achieved by running | |
96 | build processes in dedicated ``chroots'', where only their explicit | |
97 | inputs are visible. | |
98 | ||
99 | @cindex package store | |
100 | The result of package build functions is @dfn{cached} in the file | |
101 | system, in a special directory called the @dfn{package store}. In | |
102 | practice, each package is installed in a directory of its own, in the | |
103 | store---by default under @file{/nix/store}. The directory name contains | |
104 | a hash of all the inputs used to build that package; thus, changing an | |
105 | input yields a different directory name. | |
106 | ||
107 | This approach is the foundation of Guix's salient features: support for | |
108 | transactional package upgrades and rollback, per-user installation, and | |
109 | garbage collection of packages. | |
110 | ||
111 | Guix has a command-line interface allowing users to build, install, | |
112 | upgrade, and remove packages, as well as a Scheme programming interface. | |
113 | The remainder of this manual describes them. | |
114 | ||
115 | @c ********************************************************************* | |
116 | @node Programming Interface | |
117 | @chapter Programming Interface | |
118 | ||
119 | @menu | |
120 | * Defining Packages:: Defining new packages. | |
121 | * The Store:: Manipulating the package store. | |
122 | * Derivations:: Low-level interface to package derivations. | |
123 | @end menu | |
124 | ||
125 | @node Defining Packages | |
126 | @section Defining Packages | |
127 | ||
128 | @code{(guix packages)} and @code{(guix build-system)} | |
129 | ||
130 | @node The Store | |
131 | @section The Store | |
132 | ||
133 | @code{(guix store)} | |
134 | ||
135 | @node Derivations | |
136 | @section Derivations | |
137 | ||
138 | @code{(guix derivations)} | |
139 | ||
140 | @c ********************************************************************* | |
141 | @node Utilities | |
142 | @chapter Utilities | |
143 | ||
144 | @menu | |
145 | * Invoking guix-build:: Building packages from the command line. | |
146 | @end menu | |
147 | ||
148 | @node Invoking guix-build | |
149 | @section Invoking @command{guix-build} | |
150 | ||
c78bd12b LC |
151 | The @command{guix-build} command builds packages or derivations and |
152 | their dependencies, and prints the resulting store paths. It is mainly | |
153 | useful for distribution developers. The general syntax is: | |
154 | ||
155 | @example | |
156 | guix-build @var{options} @var{package-or-derivation}@dots{} | |
157 | @end example | |
158 | ||
159 | @var{package-or-derivation} may be either the name of a package found in | |
160 | the software distribution such as @code{coreutils}, or a derivation such | |
161 | as @file{/nix/store/xxx-coreutils-8.19.drv}. Alternatively, the | |
162 | @code{--expression} option may be used to specify a Scheme expression | |
163 | that evaluates to a package; this is useful when disambiguation among | |
164 | several same-named packages or package variants is needed. | |
165 | ||
166 | The @var{options} may be zero or more of the following: | |
167 | ||
168 | @table @code | |
169 | ||
170 | @item --expression=@var{expr} | |
171 | @itemx -e @var{expr} | |
172 | Build the package @var{expr} evaluates to. | |
173 | ||
174 | For example, @var{expr} may be @code{(@@ (distro packages guile) | |
175 | guile-1.8)}, which unambiguously designates this specific variant of | |
176 | version 1.8 of Guile. | |
177 | ||
178 | @item --source | |
179 | @itemx -S | |
180 | Build the packages' source derivations, rather than the packages | |
181 | themselves. | |
182 | ||
183 | For instance, @code{guix-build -S gcc} returns something like | |
184 | @file{/nix/store/xxx-gcc-4.7.2.tar.bz2}, which is GCC's source tarball. | |
185 | ||
186 | @item --system=@var{system} | |
187 | @itemx -s @var{system} | |
188 | Attempt to build for @var{system}---e.g., @code{i686-linux}---instead of | |
189 | the host's system type. | |
190 | ||
191 | An example use of this is on Linux-based systems, which can emulate | |
192 | different personalities. For instance, passing | |
193 | @code{--system=i686-linux} on an @code{x86_64-linux} system allows users | |
194 | to build packages in a complete 32-bit environment. | |
195 | ||
196 | @item --derivations | |
197 | @itemx -d | |
198 | Return the derivation paths, not the output paths, of the given | |
199 | packages. | |
200 | ||
201 | @item --keep-failed | |
202 | @itemx -K | |
203 | Keep the build tree of failed builds. Thus, if a build fail, its build | |
204 | tree is kept under @file{/tmp}, in a directory whose name is shown at | |
205 | the end of the build log. This is useful when debugging build issues. | |
206 | ||
207 | @item --dry-run | |
208 | @itemx -n | |
209 | Do not build the derivations. | |
210 | ||
211 | @item --no-substitutes | |
212 | Build instead of resorting to pre-built substitutes. | |
213 | ||
214 | @item --cores=@var{n} | |
215 | @itemx -c @var{n} | |
216 | Allow the use of up to @var{n} CPU cores for the build. The special | |
217 | value @code{0} means to use as many CPU cores as available. | |
218 | ||
219 | @item --root=@var{file} | |
220 | @itemx -r @var{file} | |
221 | Make @var{file} a symlink to the result, and register it as a garbage | |
222 | collector root. | |
223 | @end table | |
224 | ||
225 | Behind the scenes, @command{guix-build} is essentially an interface to | |
226 | the @code{package-derivation} procedure of the @code{(guix packages)} | |
227 | module, and to the @code{build-derivations} procedure of the @code{(guix | |
228 | store)} module. | |
229 | ||
230 | ||
568717fd LC |
231 | @c ********************************************************************* |
232 | @node Acknowledgments | |
233 | @chapter Acknowledgments | |
234 | ||
235 | Guix is based on the Nix package manager, which was designed and | |
236 | implemented by Eelco Dolstra. Nix pioneered functional package | |
237 | management, and promoted unprecedented features, such as transactional | |
238 | package upgrades and rollbacks, per-user profiles, and referentially | |
239 | transparent build processes. Without this work, Guix would not exist. | |
240 | ||
241 | The Nix-based software distributions, Nixpkgs and NixOS, have also been | |
242 | an inspiration for Guix. | |
243 | ||
244 | @c ********************************************************************* | |
245 | @node GNU Free Documentation License | |
246 | @appendix GNU Free Documentation License | |
247 | ||
248 | @include fdl-1.3.texi | |
249 | ||
250 | @c ********************************************************************* | |
251 | @node Concept Index | |
252 | @unnumbered Concept Index | |
253 | @printindex cp | |
254 | ||
255 | @node Function Index | |
256 | @unnumbered Function Index | |
257 | @printindex fn | |
258 | ||
259 | @bye | |
260 | ||
261 | @c Local Variables: | |
262 | @c ispell-local-dictionary: "american"; | |
263 | @c End: |