GNU Guix

From Wikipedia, the free encyclopedia
Jump to navigation Jump to search
GNU Guix
Guix logo.svg
Stable release
1.2.0[1] / November 23, 2020; 2 months ago (2020-11-23)
Repository Edit this at Wikidata
Written inGuile Scheme, C++ (Nix core)
LicenseGPLv3+
Websiteguix.gnu.org

GNU Guix (/ɡks/[2]) is a cross-platform package manager and a tool to instantiate and manage Unix-like operating systems, based on the Nix package manager with Guile Scheme APIs and specializes in providing exclusively free software.[3] GNU Guix is the default package manager of the GNU Guix System GNU/Linux distribution.

Differing from traditional package managers, Guix (like Nix) utilizes a purely functional deployment model where software is installed into unique directories generated through cryptographic hashes. Dependencies from each software are included within each hash, solving the problem of dependency hell.[4] This approach to package management promises to generate more reliable, reproducible, and portable packages.[5][6]

Guix packages are defined through functional Guile Scheme APIs specifically designed for package management. Dependencies are tracked directly in this language through special values called "derivations" which are evaluated by the Guix daemon lazily. Guix keeps track of these references automatically so that installed packages can be garbage collected when no other package depends on them. At the cost of greater storage requirements, all upgrades in Guix are guaranteed to be both atomic and efficiently rolled back. This also enables multiple users to safely install software on the same system without administrator privileges. The extra storage requirements translates to greater bandwidth usage when binary substitutes are downloaded compared to traditional package managers. If the user chooses to build everything from source even larger storage space and bandwidth is required.

The development of GNU Guix is intertwined with GNU Guix System (until Guix 1.0: Guix System Distribution [GuixSD]),[7] a complete installable GNU system using the Linux-libre kernel and GNU Shepherd init system.[8][9]

The roll-back feature of Guix is inherited from the design of Nix and is not found in any of the native package managers of popular Linux distributions such as Debian and its derivatives, Arch Linux and its derivatives, or in other major distributions such as Fedora, CentOS or OpenSUSE. The Guix package manager can however be used in such ditributions and is e.g. available for Debian[10].

The project is coordinated over the Internet by a team of volunteers and is incorporated in the French non-profit Guix Europe with members of the community.[11]

The store[edit]

Inherited from the design of Nix, most of the content of the package manager is kept in a directory /gnu/store where only the Guix daemon has write-access. This is achieved via specialised bind mounts, where the Store as a file system is mounted read only, prohibiting interference even from the root user, while the Guix daemon remounts the Store as read/writable in its own private namespace. Guix talks with this daemon to build things or fetch substitutes which are all kept in the store.

Garbage collection[edit]

Guix - like Nix - has built-in garbage collection facilities to help prune dead store items and keep the live ones.[12]

Package definitions[edit]

This is an example of a package definition for the hello-package:

(define-public hello
  (package
   (name "hello")
   (version "2.10")
   (source (origin
            (method url-fetch)
            (uri (string-append "mirror://gnu/hello/hello-" version
                                ".tar.gz"))
            (sha256
             (base32
              "0ssi1wpaf7plaswqqjwigppsg5fyh99vdlb9kzl7c9lng89ndq1i"))))
   (build-system gnu-build-system)
   (synopsis "Hello, GNU world: An example GNU package")
   (description
    "GNU Hello prints the message \"Hello, world!\" and then exits.  It
 serves as an example of standard GNU coding practices.  As such, it supports
 command-line arguments, multiple languages, and so on.")
   (home-page "https://www.gnu.org/software/hello/")
   (license gpl3+)))

It is written using Guile. The package recipes can easily be inspected (running e.g. guix edit hello) and changed in Guix, making the system transparent and very easily hackable.

Transactional upgrades[edit]

Inherited from the design of Nix, all manipulation of store items is independent of each other, and the directories of the store begin with a base32-encoded hash of the source code of the derivation along with its inputs.

Profiles[edit]

Guix package uses profiles generations, which are a collection of symlinks to specific store items together comprising what the user has installed into the profile. Every time a package is installed or removed, a new generation will be built.

E.g. the profile of a user who only installed GNU Hello contains links to the store item which holds the version of hello installed with the currently used guix.

E.g. on version c087a90e06d7b9451f802323e24deb1862a21e0f of guix, this corresponds to the following item: /gnu/store/md2plii4g5sk66wg9cgwc964l3xwhrm9-hello-2.10 (built from the recipe above).

In addition to symlinks, each profile guix builds also contains a union of all the info-manuals, man-pages, icons, fonts, etc. so that the user can browse documentation and have access to all the icons and fonts installed.

The default symlinks to profile generations are stored under /var/guix in the filesystem.

Multiple user profiles[edit]

The user can create any number of profiles by invoking guix package -p PROFILE-NAME COMMAND. A new directory with the profile-name as well as profile-generation-symlinks will then be created in the current directory.

Roll-back[edit]

Guix package enables instantaneous roll-back to a previous profile generation via changing the symlink to an earlier profile generation.[13] Profiles are also stored in the store e.g. this item is a profile containing hello above: /gnu/store/b4wipjlsapvnijmbawl7sh76087vpl4n-profile (built and activated when running guix install hello).

Environment[edit]

Guix environment enables the user to easily enter an environment where all the necessary packages for development of software are present without clogging up the users default profile with dependencies for multiple projects.[14]

E.g. running guix environment hello enters a throw-away environment where everything needed to compile hello on guix is present (gcc, guile, etc.).

Persistent development environment[edit]

If you want a persistent gc-rooted environment that is not garbage collected on the next run of guix gc you can create a root:

E.g. running guix environment --root=hello-root hello enters an environment where everything needed to compile guix is present (gcc, guile, etc.) and registered as a root in the current directory (by symlinking to the items in the store).

Pack[edit]

Guix pack enables the user to bundle together store items and output them as a docker binary image, a relocatable tarball or a squashfs binary.[15]

Graph[edit]

Guix graph enables the user to view different graphs of the packages and their dependencies.[16]

Guix System (operating system)[edit]

GNU Guix System uses Guix as its package manager and configuration system, similar to how NixOS uses Nix, Debian uses APT, etc.

History[edit]

The GNU Project announced in November 2012 the first release of GNU Guix, a functional package manager based on Nix that provides, among other things, Guile Scheme APIs.[17] The project was started in June 2012 by Ludovic Courtès, one of the GNU Guile hackers.[18] On August 20, 2015, it was announced that Guix had been ported to GNU Hurd.[19]

Releases[edit]

The project has no fixed release schedule and has until now released approximately every 6 months.

Version Announcement Supported architectures Packages
0.1 (alpha) Courtès, Ludovic (18 January 2013). "GNU Guix 0.1 released (alpha)". i686, x86_64 ~150
0.2 (alpha) Courtès, Ludovic (12 May 2013). "GNU Guix 0.2 released (alpha)". ~400
0.3 Courtès, Ludovic (17 Jul 2013). "GNU Guix 0.3 released". ~430
0.4 Courtès, Ludovic (27 Sep 2013). "GNU Guix 0.4 released". ~490
0.5 Courtès, Ludovic (11 Dec 2013). "GNU Guix 0.5 released". ~600
0.6 Courtès, Ludovic (9 Apr 2014). "GNU Guix 0.6 released". ~691
0.7 Courtès, Ludovic (25 Jul 2014). "GNU Guix 0.7 released". ~825
0.8 Courtès, Ludovic (18 Nov 2014). "GNU Guix 0.8 released". i686, x86_64, mips64el ~987
0.8.1 Courtès, Ludovic (29 Jan 2015). "GNU Guix 0.8.1 released". i686, x86_64, mips64el, armv7 ~1151
0.8.2 Courtès, Ludovic (14 May 2015). "GNU Guix 0.8.2 released". ~1869
0.8.3 Courtès, Ludovic (22 Jul 2015). "GNU Guix 0.8.3 released". ~2048
0.9.0 Courtès, Ludovic (5 Nov 2015). "GNU Guix 0.9.0 released". ~2591
0.10.0 Courtès, Ludovic (29 Mar 2016). "GNU Guix & GuixSD 0.10.0 released". ~3230
0.11.0 Courtès, Ludovic (3 Aug 2016). "GNU Guix & GuixSD 0.11.0 released". ~3714
0.12.0 Wurmus, Ricardo (21 Dec 2016). "GNU Guix & GuixSD 0.12.0 released". ~4567
0.13.0 Courtès, Ludovic (22 May 2017). "GNU Guix & GuixSD 0.13.0 released". i686, x86_64, mips64el, armv7, aarch64 ~5407
0.14.0 Courtès, Ludovic (7 Dec 2017). "GNU Guix & GuixSD 0.14.0 released". ~6618
0.15.0 Courtès, Ludovic (6 Jul 2018). "GNU Guix & GuixSD 0.15.0 released". ~7857
0.16.0 Courtès, Ludovic (6 Dec 2018). "GNU Guix & GuixSD 0.16.0 released". ~8715
1.0.0 Courtès, Ludovic (2 May 2019). "GNU Guix 1.0.0 released". ~9712
1.0.1 Courtès, Ludovic (19 May 2019). "GNU Guix 1.0.1 released". ~9771
1.1.0 Courtès, Ludovic (15 April 2020). "GNU Guix 1.1.0 released". i686, x86_64, armv7, aarch64 ~13161
1.2.0 Courtès, Ludovic (23 November 2020). "GNU Guix 1.2.0 released". i686, x86_64, armv7, aarch64 ~15333

See also[edit]

References[edit]

  1. ^ Ludovic Courtès (2020-11-23). "GNU Guix 1.2.0 released". Retrieved 2020-11-24.
  2. ^ "GNU Guix Reference Manual". www.gnu.org. Retrieved 23 April 2018.
  3. ^ Ludovic Courtès (2013). "Functional Package Management with Guix". Madrid, Spain: European Lisp Symposium.
  4. ^ Prins, P., Suresh, J. and Dolstra, E., "Nix fixes dependency hell on all Linux distributions," Archived December 26, 2008, at the Wayback Machine linux.com, December 22, 2008
  5. ^ Dolstra, E., de Jonge, M. and Visser, E. "Nix: A Safe and Policy-Free System for Software Deployment." In Damon, L. (Ed.), 18th Large Installation System Administration Conference (LISA '04), pages 79–92, Atlanta, Georgia, USA. USENIX, November 2004.
  6. ^ Dolstra, E. The Purely Functional Software Deployment Model. PhD thesis, Faculty of Science, Utrecht, The Netherlands. January 2006. ISBN 90-393-4130-3.
  7. ^ "What to call Guix?" (Mailing list). gnu-system-discuss. 2015-01-15.
  8. ^ Programming Interface (GNU Guix Reference Manual)
  9. ^ Guix: A New Package Manager & GNU Distribution - Phoronix
  10. ^ https://tracker.debian.org/pkg/guix
  11. ^ "guix-europe". git.savannah.gnu.org. Retrieved 16 May 2019.
  12. ^ "Invoking guix gc". gnu.org. Retrieved 16 May 2019.
  13. ^ "Invoking guix package". gnu.org. Retrieved 16 May 2019.
  14. ^ "Invoking guix environment". gnu.org. Retrieved 16 May 2019.
  15. ^ "Invoking guix pack". gnu.org. Retrieved 16 May 2019.
  16. ^ "Invoking guix graph". gnu.org. Retrieved 16 May 2019.
  17. ^ Courtès, Ludovic (2012-11-23). "Introducing GNU Guix" (Mailing list). gnu-system-discuss.
  18. ^ Stallman, Richard (2012-06-05). "A GNU Distribution" (Mailing list). gnu-system-discuss.
  19. ^ Ragkousis, Manolis (August 20, 2015). "[GSoC update] Porting Guix to GNU/Hurd" (Mailing list). guix-devel. Retrieved August 20, 2015.
  20. ^ "About — GuixSD". www.gnu.org. Retrieved 2018-05-03.

External links[edit]