Mirror of GNU Guix
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

153 lines
6.4 KiB

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