README 6.4 KB

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