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