GNU Guix


GNU Guix 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. Differing from traditional package managers, Guix 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. This approach to package management promises to generate more reliable, reproducible, and portable packages.
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 distributions such as Debian. 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 Guix System, a complete installable GNU system using the Linux-libre kernel and GNU Shepherd init system.
The roll-back feature of Guix is inherited from the design of Nix and is not found in any of the 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 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.

Features

These features are related to the package management features of Guix. See below for the features of Guix System.

The store

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

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

Package definitions

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




))




))

It is written using Guile. The package recipes can easily be inspected and changed in Guix, making the system transparent and very easily hackable.

Transactional upgrades

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

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.
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

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

Guix package enables instantaneous roll-back to a previous profile generation via changing the symlink to an earlier profile generation. Profiles are also stored in the store e.g. this item is a profile containing hello above: /gnu/store/b4wipjlsapvnijmbawl7sh76087vpl4n-profile.

Environment

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.
E.g. running guix environment hello enters a throw-away environment where everything needed to compile hello on guix is present.

Persistent development environment

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 and registered as a root in the current directory.

Pack

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.

Graph

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

Guix System (operating system)

Guix System is a Linux distribution built around the GNU Guix package manager. It enables a declarative operating system configuration and allows reliable system upgrades that can easily be rolled back. It uses the Linux-libre kernel, with support for the GNU Hurd kernel under development. On February 3, 2015, the distribution was added to the Free Software Foundation's list of free Linux distributions.

Architecture support

The following CPU architectures are supported: IA-32, x64, AArch32, AArch64 and in April 2019 work was in progress for POWER9 support.

Features

System services

System services are a core feature in Guix System that enable the user to declaratively compose the configuration of daemons and background services and easily specify the relevant configurations.
This enables the user to within a single configuration file declare the whole OS.
System services can:
Ricardo Wurmus, one of the maintainers, explains the extendability like this:
All the services are defined using Guile Scheme. The list of services continue to grow and as of 1.0.0 the list of services includes the following:
Guix System uses the GNU Daemon Shepherd as its init system, which is developed in tandem with Guix and is written in Guile as well. It was previously known as "dmd", which stood for "Daemon managing Daemons" or "Daemons-managing Daemon", but changed names to avoid collision with the Digital Mars D compiler.
Shepherd supplies user-space functionality asynchronously as services, which under Shepherd are generic functions and object data types that are exported for use by the Shepherd to extend the base operating system in some defined way. In contrast to systemd, a userspace shepherd process runs as that user. Core to the Shepherd model of user space initialisation is the concept of the extension, a form of composability where services are designed to be layered onto other services, augmenting them with more elaborate or specialised behaviours as desired. This expresses the instantiation-based dependency relationships found in many modern init systems, making the system modular, but also allows services to interact variadically with other services in arbitrary ways.
Shepherd also provides so-called virtual services which allow dynamic dispatch over a class of related service objects, such as all those which instantiate a mail transfer agent for the system. A system governed via the Shepherd daemon can represent its user space as a directed acyclic graph, with the "system-service" − responsible for early phases of boot and init − as its root, and all subsequently initialised services as extensions to system-service's functionality, either directly or transitively over other services.
Being both written and configured in Guile Scheme, GNU Shepherd is intended to be highly programmable by the system administrator, but it can also be used to manage per-user profiles of unprivileged daemons and services. Its services and configuration are stored uniformly as object-oriented Scheme code, and while a core set of services are provided with the basic Guix System, arbitrary new services can be flexibly declared, and through Guile's object system, GOOPS, existing services can be redefined at the user's discretion by asking the Shepherd to dynamically rewrite services in specified ways on instantiation.
GNU Shepherd was originally designed to work with GNU Hurd, and was later adopted by Guix System.

Release and stability

Guix System to date has only an unstable development git repository shared with Guix but enables users or organizations to set up stable release channels themselves via the channel-feature.

Updates

Packages in Guix are generally very up-to-date thanks to the lack of a package maintainer bottleneck: anyone can contribute an update subject to community approval and the process is assisted by tools such as guix refresh.
Changes to the git repository are peer-reviewed by community members and committed by one of the 45 people with commit access. In practice sometimes these builds cause system breakages for users because of a typo or similar error, but these are often solved within minutes. The way Guix pull operates means users retain a working system in the meantime.

Roll-back

If a system update should leave users with a broken system, users can easily roll back individual packages as well as the whole system state. This means that a stable channel which is very common in other Linux distributions is no longer needed for users who are willing to report a bug and wait a few minutes, when trying to update via guix pull.

History

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. The project was started in June 2012 by Ludovic Courtès, one of the GNU Guile hackers. On August 20, 2015, it was announced that Guix had been ported to GNU Hurd.

Releases

The project has no fixed release schedule and has until now released approximately every 6 months.
VersionAnnouncementSupported architecturesPackages
0.1 i686, x86_64~150
0.2 i686, x86_64~400
0.3i686, x86_64~430
0.4i686, x86_64~490
0.5i686, x86_64~600
0.6i686, x86_64~691
0.7i686, x86_64~825
0.8i686, x86_64, mips64el~987
0.8.1i686, x86_64, mips64el, armv7~1151
0.8.2i686, x86_64, mips64el, armv7~1869
0.8.3i686, x86_64, mips64el, armv7~2048
0.9.0i686, x86_64, mips64el, armv7~2591
0.10.0i686, x86_64, mips64el, armv7~3230
0.11.0i686, x86_64, mips64el, armv7~3714
0.12.0i686, x86_64, mips64el, armv7~4567
0.13.0i686, x86_64, mips64el, armv7, aarch64~5407
0.14.0i686, x86_64, mips64el, armv7, aarch64~6618
0.15.0i686, x86_64, mips64el, armv7, aarch64~7857
0.16.0i686, x86_64, mips64el, armv7, aarch64~8715
1.0.0i686, x86_64, mips64el, armv7, aarch64~9712
1.0.1i686, x86_64, mips64el, armv7, aarch64~9771
1.1.0i686, x86_64, armv7, aarch64~13161

Reception

Guix System

Jesse Smith from DistroWatch Weekly reviewed GuixSD 0.15.0, and said, "GuixSD has a package manager that I like", but criticized the limited hardware support and its limited documentation. The documentation has since then been expanded and improved with videos and a cookbook in six languages with tutorials, how-to guides and examples.