Merge branch 'master' into core-updates
[jackhill/guix/guix.git] / README
1 -*- mode: org -*-
2
3 [[http://www.gnu.org/software/guix/][GNU Guix]] (IPA: /ɡiːks/) is a purely functional package manager, and
4 associated free software distribution, for the [[http://www.gnu.org/gnu/gnu.html][GNU system]]. In addition
5 to standard package management features, Guix supports transactional
6 upgrades and roll-backs, unprivileged package management, per-user
7 profiles, and garbage collection.
8
9 It provides [[http://www.gnu.org/software/guile/][Guile]] Scheme APIs, including a high-level embedded
10 domain-specific languages (EDSLs) to describe how packages are to be
11 built and composed.
12
13 A user-land free software distribution for GNU/Linux comes as part of
14 Guix.
15
16 Guix is based on the [[http://nixos.org/nix/][Nix]] package manager.
17
18
19 * Requirements
20
21 GNU Guix currently depends on the following packages:
22
23 - [[http://gnu.org/software/guile/][GNU Guile 2.0.x]]
24 - [[http://gnupg.org/][GNU libgcrypt]]
25
26 Unless `--disable-daemon' was passed, the following packages are needed:
27
28 - [[http://sqlite.org/][SQLite 3]]
29 - [[http://www.bzip.org][libbz2]]
30 - [[http://gcc.gnu.org][GCC's g++]]
31
32 When `--disable-daemon' was passed, you instead need the following:
33
34 - [[http://nixos.org/nix/][Nix]]
35
36 Optionally, packages from Nixpkgs may be transparently reused from Guix.
37 For this to work, you need to have a checkout of the Nixpkgs repository;
38 the `--with-nixpkgs' option allows you to let `configure' know where the
39 Nixpkgs checkout is.
40
41 - [[http://nixos.org/nixpkgs/][Nixpkgs]]
42
43 When building Guix from a checkout, the following packages are also
44 required:
45
46 - [[http://www.gnu.org/software/autoconf/][GNU Autoconf]]
47 - [[http://www.gnu.org/software/automake/][GNU Automake]]
48 - [[http://www.gnu.org/software/gettext/][GNU Gettext]]
49
50 The "autoreconf -vi" command can be used to generate the build system
51 infrastructure; it reports an error if an inappropriate version of the
52 above packages is being used.
53
54 * How It Works
55
56 Guix does the high-level preparation of a /derivation/. A derivation is
57 the promise of a build; it is stored as a text file under
58 =/nix/store/xxx.drv=. The (guix derivations) module provides the
59 `derivation' primitive, as well as higher-level wrappers such as
60 `build-expression->derivation'.
61
62 Guix does remote procedure calls (RPCs) to the Guix or Nix daemon (the
63 =guix-daemon= or =nix-daemon= command), which in turn performs builds
64 and accesses to the Nix store on its behalf. The RPCs are implemented
65 in the (guix store) module.
66
67 * Installing Guix as non-root
68
69 The Guix daemon allows software builds to be performed under alternate
70 user accounts, which are normally created specifically for this
71 purpose. For instance, you may have a pool of accounts in the
72 =guixbuild= group, and then you can instruct =guix-daemon= to use them
73 like this:
74
75 $ guix-daemon --build-users-group=guixbuild
76
77 However, unless it is run as root, =guix-daemon= cannot switch users.
78 In that case, it falls back to using a setuid-root helper program call
79 =nix-setuid-helper=. That program is not setuid-root by default when
80 you install it; instead you should run a command along these lines
81 (assuming Guix is installed under /usr/local):
82
83 # chown root.root /usr/local/libexec/nix-setuid-helper
84 # chmod 4755 /usr/local/libexec/nix-setuid-helper
85
86 * Contact
87
88 GNU Guix is hosted at https://savannah.gnu.org/projects/guix/.
89
90 Please email <bug-guix@gnu.org> for bug reports or questions regarding
91 Guix and its distribution; email <gnu-system-discuss@gnu.org> for
92 general issues regarding the GNU system.
93
94 Join #guix on irc.freenode.net.
95
96 * Guix & Nix
97
98 GNU Guix is based on [[http://nixos.org/nix/][the Nix package manager]]. It implements the same
99 package deployment paradigm, and in fact it reuses some of its code.
100 Yet, different engineering decisions were made for Guix, as described
101 below.
102
103 Nix is really two things: a package build tool, implemented by a library
104 and daemon, and a special-purpose programming language. GNU Guix relies
105 on the former, but uses Scheme as a replacement for the latter.
106
107 Using Scheme instead of a specific language allows us to get all the
108 features and tooling that come with Guile (compiler, debugger, REPL,
109 Unicode, libraries, etc.) And it means that we have a general-purpose
110 language, on top of which we can have embedded domain-specific languages
111 (EDSLs), such as the one used to define packages. This broadens what
112 can be done in package recipes themselves, and what can be done around them.
113
114 Technically, Guix makes remote procedure calls to the ‘nix-worker’
115 daemon to perform operations on the store. At the lowest level, Nix
116 “derivations” represent promises of a build, stored in ‘.drv’ files in
117 the store. Guix produces such derivations, which are then interpreted
118 by the daemon to perform the build. Thus, Guix derivations can use
119 derivations produced by Nix (and vice versa).
120
121 With Nix and the [[http://nixos.org/nixpkgs][Nixpkgs]] distribution, package composition happens at
122 the Nix language level, but builders are usually written in Bash.
123 Conversely, Guix encourages the use of Scheme for both package
124 composition and builders. Likewise, the core functionality of Nix is
125 written in C++ and Perl; Guix relies on some of the original C++ code,
126 but exposes all the API as Scheme.
127
128 * Related software
129
130 - [[http://nixos.org][Nix, Nixpkgs, and NixOS]], functional package manager and associated
131 software distribution, are the inspiration of Guix
132 - [[http://www.gnu.org/software/stow/][GNU Stow]] builds around the idea of one directory per prefix, and a
133 symlink tree to create user environments
134 - [[http://www.pvv.ntnu.no/~arnej/store/storedoc_6.html][STORE]] shares the same idea
135 - [[https://live.gnome.org/OSTree/][GNOME's OSTree]] allows bootable system images to be built from a
136 specified set of packages
137 - The [[http://www.gnu.org/s/gsrc/][GNU Source Release Collection]] (GSRC) is a user-land software
138 distribution; unlike Guix, it relies on core tools available on the
139 host system