Merge branch 'master' into core-updates
[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
50The "autoreconf -vi" command can be used to generate the build system
51infrastructure; it reports an error if an inappropriate version of the
52above packages is being used.
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
59 - install the dependencies (see 'Requirements' above) using Guix
60 - re-run the configure script passing it the option
61 `--with-libgcrypt-prefix=$HOME/.guix-profile/'
62 - run "make" and "make install"
63
4255d4e3
LC
64* How It Works
65
66Guix does the high-level preparation of a /derivation/. A derivation is
67the promise of a build; it is stored as a text file under
68=/nix/store/xxx.drv=. The (guix derivations) module provides the
69`derivation' primitive, as well as higher-level wrappers such as
70`build-expression->derivation'.
71
e1b7096a
LC
72Guix does remote procedure calls (RPCs) to the Guix or Nix daemon (the
73=guix-daemon= or =nix-daemon= command), which in turn performs builds
74and accesses to the Nix store on its behalf. The RPCs are implemented
75in the (guix store) module.
76
77* Installing Guix as non-root
78
79The Guix daemon allows software builds to be performed under alternate
80user accounts, which are normally created specifically for this
81purpose. For instance, you may have a pool of accounts in the
82=guixbuild= group, and then you can instruct =guix-daemon= to use them
83like this:
84
85 $ guix-daemon --build-users-group=guixbuild
86
87However, unless it is run as root, =guix-daemon= cannot switch users.
88In that case, it falls back to using a setuid-root helper program call
89=nix-setuid-helper=. That program is not setuid-root by default when
90you install it; instead you should run a command along these lines
91(assuming Guix is installed under /usr/local):
92
93 # chown root.root /usr/local/libexec/nix-setuid-helper
94 # chmod 4755 /usr/local/libexec/nix-setuid-helper
4255d4e3
LC
95
96* Contact
97
a65e3306
LC
98GNU Guix is hosted at https://savannah.gnu.org/projects/guix/.
99
100Please email <bug-guix@gnu.org> for bug reports or questions regarding
101Guix and its distribution; email <gnu-system-discuss@gnu.org> for
102general issues regarding the GNU system.
103
104Join #guix on irc.freenode.net.
105
106* Guix & Nix
107
108GNU Guix is based on [[http://nixos.org/nix/][the Nix package manager]]. It implements the same
109package deployment paradigm, and in fact it reuses some of its code.
110Yet, different engineering decisions were made for Guix, as described
111below.
112
113Nix is really two things: a package build tool, implemented by a library
114and daemon, and a special-purpose programming language. GNU Guix relies
115on the former, but uses Scheme as a replacement for the latter.
116
117Using Scheme instead of a specific language allows us to get all the
118features and tooling that come with Guile (compiler, debugger, REPL,
119Unicode, libraries, etc.) And it means that we have a general-purpose
120language, on top of which we can have embedded domain-specific languages
121(EDSLs), such as the one used to define packages. This broadens what
122can be done in package recipes themselves, and what can be done around them.
123
124Technically, Guix makes remote procedure calls to the ‘nix-worker’
125daemon to perform operations on the store. At the lowest level, Nix
126“derivations” represent promises of a build, stored in ‘.drv’ files in
127the store. Guix produces such derivations, which are then interpreted
128by the daemon to perform the build. Thus, Guix derivations can use
129derivations produced by Nix (and vice versa).
130
131With Nix and the [[http://nixos.org/nixpkgs][Nixpkgs]] distribution, package composition happens at
132the Nix language level, but builders are usually written in Bash.
133Conversely, Guix encourages the use of Scheme for both package
134composition and builders. Likewise, the core functionality of Nix is
135written in C++ and Perl; Guix relies on some of the original C++ code,
136but exposes all the API as Scheme.
d38487e9
LC
137
138* Related software
139
140 - [[http://nixos.org][Nix, Nixpkgs, and NixOS]], functional package manager and associated
141 software distribution, are the inspiration of Guix
142 - [[http://www.gnu.org/software/stow/][GNU Stow]] builds around the idea of one directory per prefix, and a
143 symlink tree to create user environments
144 - [[http://www.pvv.ntnu.no/~arnej/store/storedoc_6.html][STORE]] shares the same idea
145 - [[https://live.gnome.org/OSTree/][GNOME's OSTree]] allows bootable system images to be built from a
146 specified set of packages
147 - The [[http://www.gnu.org/s/gsrc/][GNU Source Release Collection]] (GSRC) is a user-land software
148 distribution; unlike Guix, it relies on core tools available on the
149 host system