README 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156
  1. -*- mode: org -*-
  2. [[https://www.gnu.org/software/guix/][GNU Guix]] (IPA: /ɡiːks/) is a purely functional package manager, and
  3. associated free software distribution, for the [[https://www.gnu.org/gnu/gnu.html][GNU system]]. In addition
  4. to standard package management features, Guix supports transactional
  5. upgrades and roll-backs, unprivileged package management, per-user
  6. profiles, and garbage collection.
  7. It provides [[https://www.gnu.org/software/guile/][Guile]] Scheme APIs, including a high-level embedded
  8. domain-specific languages (EDSLs) to describe how packages are to be
  9. built and composed.
  10. A user-land free software distribution for GNU/Linux comes as part of
  11. Guix.
  12. Guix is based on the [[https://nixos.org/nix/][Nix]] package manager.
  13. * Requirements
  14. GNU Guix currently depends on the following packages:
  15. - [[https://gnu.org/software/guile/][GNU Guile 2.2.x or 2.0.x]], version 2.0.13 or later
  16. - [[https://notabug.org/cwebber/guile-gcrypt][Guile-Gcrypt]] 0.1.0 or later
  17. - [[https://www.gnu.org/software/make/][GNU Make]]
  18. - [[https://www.gnutls.org][GnuTLS]] compiled with guile support enabled
  19. - [[https://notabug.org/guile-sqlite3/guile-sqlite3][Guile-SQLite3]], version 0.1.0 or later
  20. - [[https://gitlab.com/guile-git/guile-git][Guile-Git]]
  21. - [[http://www.zlib.net/][zlib]]
  22. - [[https://savannah.nongnu.org/projects/guile-json/][Guile-JSON]]
  23. Unless `--disable-daemon' was passed, the following packages are needed:
  24. - [[https://gnupg.org/][GNU libgcrypt]]
  25. - [[https://sqlite.org/][SQLite 3]]
  26. - [[https://gcc.gnu.org][GCC's g++]]
  27. - optionally [[http://www.bzip.org][libbz2]]
  28. When `--disable-daemon' was passed, you instead need the following:
  29. - [[https://nixos.org/nix/][Nix]]
  30. * Installation
  31. See the manual for the installation instructions, either by running
  32. info -f doc/guix.info "Installation"
  33. or by checking the [[https://www.gnu.org/software/guix/manual/guix.html#Installation][web copy of the manual]].
  34. For information on installation from a Git checkout, please see the section
  35. "Building from Git" in the manual.
  36. * Installing Guix from Guix
  37. You can re-build and re-install Guix using a system that already runs Guix.
  38. To do so:
  39. - Start a shell with the development environment for Guix:
  40. guix environment guix
  41. - Re-run the 'configure' script passing it the option
  42. '--localstatedir=/somewhere', where '/somewhere' is the 'localstatedir'
  43. value of the currently installed Guix (failing to do that would lead the
  44. new Guix to consider the store to be empty!).
  45. - Run "make", "make check", and "make install".
  46. * How It Works
  47. Guix does the high-level preparation of a /derivation/. A derivation is
  48. the promise of a build; it is stored as a text file under
  49. =/gnu/store/xxx.drv=. The (guix derivations) module provides the
  50. `derivation' primitive, as well as higher-level wrappers such as
  51. `build-expression->derivation'.
  52. Guix does remote procedure calls (RPCs) to the Guix or Nix daemon (the
  53. =guix-daemon= or =nix-daemon= command), which in turn performs builds
  54. and accesses to the Nix store on its behalf. The RPCs are implemented
  55. in the (guix store) module.
  56. * Installing Guix as non-root
  57. The Guix daemon allows software builds to be performed under alternate
  58. user accounts, which are normally created specifically for this
  59. purpose. For instance, you may have a pool of accounts in the
  60. =guixbuild= group, and then you can instruct =guix-daemon= to use them
  61. like this:
  62. $ guix-daemon --build-users-group=guixbuild
  63. However, unless it is run as root, =guix-daemon= cannot switch users.
  64. In that case, it falls back to using a setuid-root helper program call
  65. =nix-setuid-helper=. That program is not setuid-root by default when
  66. you install it; instead you should run a command along these lines
  67. (assuming Guix is installed under /usr/local):
  68. # chown root.root /usr/local/libexec/nix-setuid-helper
  69. # chmod 4755 /usr/local/libexec/nix-setuid-helper
  70. * Contact
  71. GNU Guix is hosted at https://savannah.gnu.org/projects/guix/.
  72. Please email <bug-guix@gnu.org> for bug reports or questions regarding
  73. Guix and its distribution; email <gnu-system-discuss@gnu.org> for
  74. general issues regarding the GNU system.
  75. Join #guix on irc.freenode.net.
  76. * Guix & Nix
  77. GNU Guix is based on [[https://nixos.org/nix/][the Nix package manager]]. It implements the same
  78. package deployment paradigm, and in fact it reuses some of its code.
  79. Yet, different engineering decisions were made for Guix, as described
  80. below.
  81. Nix is really two things: a package build tool, implemented by a library
  82. and daemon, and a special-purpose programming language. GNU Guix relies
  83. on the former, but uses Scheme as a replacement for the latter.
  84. Using Scheme instead of a specific language allows us to get all the
  85. features and tooling that come with Guile (compiler, debugger, REPL,
  86. Unicode, libraries, etc.) And it means that we have a general-purpose
  87. language, on top of which we can have embedded domain-specific languages
  88. (EDSLs), such as the one used to define packages. This broadens what
  89. can be done in package recipes themselves, and what can be done around them.
  90. Technically, Guix makes remote procedure calls to the ‘nix-worker’
  91. daemon to perform operations on the store. At the lowest level, Nix
  92. “derivations” represent promises of a build, stored in ‘.drv’ files in
  93. the store. Guix produces such derivations, which are then interpreted
  94. by the daemon to perform the build. Thus, Guix derivations can use
  95. derivations produced by Nix (and vice versa).
  96. With Nix and the [[https://nixos.org/nixpkgs][Nixpkgs]] distribution, package composition happens at
  97. the Nix language level, but builders are usually written in Bash.
  98. Conversely, Guix encourages the use of Scheme for both package
  99. composition and builders. Likewise, the core functionality of Nix is
  100. written in C++ and Perl; Guix relies on some of the original C++ code,
  101. but exposes all the API as Scheme.
  102. * Related software
  103. - [[https://nixos.org][Nix, Nixpkgs, and NixOS]], functional package manager and associated
  104. software distribution, are the inspiration of Guix
  105. - [[https://www.gnu.org/software/stow/][GNU Stow]] builds around the idea of one directory per prefix, and a
  106. symlink tree to create user environments
  107. - [[https://www.pvv.ntnu.no/~arnej/store/storedoc_6.html][STORE]] shares the same idea
  108. - [[https://live.gnome.org/OSTree/][GNOME's OSTree]] allows bootable system images to be built from a
  109. specified set of packages
  110. - The [[https://www.gnu.org/s/gsrc/][GNU Source Release Collection]] (GSRC) is a user-land software
  111. distribution; unlike Guix, it relies on core tools available on the
  112. host system