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.

149 lines
6.2 KiB

  1. -*- mode: org -*-
  2. [[http://www.gnu.org/software/guix/][GNU Guix]] (IPA: /ɡiːks/) is a purely functional package manager, and
  3. associated free software distribution, for the [[http://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 [[http://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 [[http://nixos.org/nix/][Nix]] package manager.
  13. * Requirements
  14. GNU Guix currently depends on the following packages:
  15. - [[http://gnu.org/software/guile/][GNU Guile 2.0.x]]
  16. - [[http://gnupg.org/][GNU libgcrypt]]
  17. Unless `--disable-daemon' was passed, the following packages are needed:
  18. - [[http://sqlite.org/][SQLite 3]]
  19. - [[http://www.bzip.org][libbz2]]
  20. - [[http://gcc.gnu.org][GCC's g++]]
  21. When `--disable-daemon' was passed, you instead need the following:
  22. - [[http://nixos.org/nix/][Nix]]
  23. Optionally, packages from Nixpkgs may be transparently reused from Guix.
  24. For this to work, you need to have a checkout of the Nixpkgs repository;
  25. the `--with-nixpkgs' option allows you to let `configure' know where the
  26. Nixpkgs checkout is.
  27. - [[http://nixos.org/nixpkgs/][Nixpkgs]]
  28. When building Guix from a checkout, the following packages are also
  29. required:
  30. - [[http://www.gnu.org/software/autoconf/][GNU Autoconf]]
  31. - [[http://www.gnu.org/software/automake/][GNU Automake]]
  32. - [[http://www.gnu.org/software/gettext/][GNU Gettext]]
  33. The "autoreconf -vi" command can be used to generate the build system
  34. infrastructure; it reports an error if an inappropriate version of the
  35. above packages is being used.
  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. - install the dependencies (see 'Requirements' above) using Guix
  40. - re-run the configure script passing it the option
  41. `--with-libgcrypt-prefix=$HOME/.guix-profile/'
  42. - run "make" 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. =/nix/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 [[http://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 [[http://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. - [[http://nixos.org][Nix, Nixpkgs, and NixOS]], functional package manager and associated
  101. software distribution, are the inspiration of Guix
  102. - [[http://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. - [[http://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 [[http://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