GNU Guix

Also known as: Guix

On this page 8

GNU Guix is a functional package manager and the basis of a Linux distribution, Guix System, in which every package is a pure build recipe whose output is stored under a path derived from a cryptographic hash of all its inputs. In Linux package management, it belongs to the same family as Nix: installing, upgrading and removing software are transactional operations that never overwrite files in place, so any previous state can be restored with a single rollback.

Guix is written and configured in GNU Guile, a dialect of Scheme, which means package definitions, user manifests and whole operating system declarations are ordinary programs. It can run as a standalone distribution or on top of an existing system such as Debian or Fedora, next to APT or DNF, without interfering with them.

How GNU Guix builds and stores packages

Guix treats a package build as a mathematical function: the same source code, dependencies, build script and options always produce the same output. Each result is written to the read-only store at /gnu/store, in a directory such as /gnu/store/<hash>-hello-2.12, where the hash covers every input of the build, including the compiler and the C library.

Builds are performed by guix-daemon, a privileged service that runs each job in an isolated build container with a dedicated build user, no network access and only the declared inputs visible. This isolation removes undeclared dependencies, the most common cause of builds that work on one machine and fail on another. Users never write to the store directly; they ask the daemon, which is why unprivileged users can install software safely.

The main building blocks of the system are summarized below.

ComponentRolePractical consequence
StoreHolds every built package under a hashed pathMany versions coexist without conflicts
DaemonPerforms isolated builds and store writesBuilds are repeatable and safe for multiple users
ProfileSet of symbolic links to store itemsEach user sees only the packages chosen
GenerationNumbered snapshot of a profileRollback is a pointer switch, not a reinstall
ChannelGit repository of package definitionsThe package collection is versioned like code
SubstitutePrebuilt binary for a known store pathDownloads replace local compilation when trusted
Core components of GNU Guix

Profiles, generations and rollbacks

A profile is a directory tree of symbolic links that point into the store, and the shell finds programs through it via PATH. When a user runs guix install, Guix builds a new profile generation next to the old one and then switches a single link atomically. If the operation is interrupted, the previous generation remains intact, so the system is never left half-upgraded.

The command guix package --roll-back returns to the preceding generation, and guix package --list-generations shows the full history. Guix System applies the same idea to the whole operating system: each guix system reconfigure creates a bootable system generation, and older generations appear in the boot menu as a recovery path.

Old generations keep their store items alive. Running guix gc removes items that no generation references, so disk usage grows until generations are deleted and garbage collection is run.

Channels, substitutes and reproducibility

The package collection arrives through channels, which are Git repositories of Scheme definitions. The command guix pull updates the channels and the Guix tool itself, and guix describe prints the exact channel commits in use. Recording that output allows guix time-machine to recreate the same package set months or years later, a property valued in scientific computing and research software.

Compiling everything locally would be slow, so Guix fetches substitutes, prebuilt binaries from build farms whose signing keys the administrator has authorized. Because the store path depends only on inputs, a substitute is interchangeable with a local build. The command guix challenge compares local results with substitute servers to detect non-reproducible or tampered builds.

Guix also pursues a full-source bootstrap: the toolchain is built from a very small auditable binary seed rather than from large opaque compiler binaries. This reduces the risk of a trusting-trust attack, in which a compromised compiler silently infects everything built with it.

The following commands cover most daily work.

CommandPurposeTypical use
guix installAdd packages to the user profileInstall an editor without root
guix pullUpdate channels and the Guix toolFetch new package versions
guix upgradeRebuild the profile with newer versionsRoutine updates
guix shellStart a temporary environmentProject dependencies without installing
guix time-machineRun Guix at a recorded channel stateReproduce an old experiment
guix packExport a closure as tarball or Docker imageDeploy to machines without Guix
guix system reconfigureApply an operating system declarationChange services on Guix System
Frequently used Guix commands

Guix differs from traditional Linux package managers mainly in where files live and how state changes. Tools such as dpkg, RPM and Pacman install into shared directories like /usr, so only one version of a library can normally exist at a time, and an upgrade modifies the running system in place.

ToolModelRollbackConfiguration language
GNU GuixFunctional, hashed storeBuilt in, per profile and systemGuile Scheme
NixFunctional, hashed storeBuilt in, per profile and systemNix expression language
APT with dpkgShared file system treeNot native; needs snapshotsControl files and shell scripts
DNF with RPMShared file system treeTransaction history, limitedSpec files
FlatpakSandboxed desktop applicationsPer application commitJSON or YAML manifests
GNU Guix compared with neighboring tools

Guix and Nix share the same store model and historically the same daemon design, but they differ in philosophy. Guix uses a general-purpose programming language instead of a domain-specific one, and its official channel accepts only free software under the GNU Free System Distribution Guidelines. Proprietary firmware and drivers are available only through third-party channels, which matters on hardware that needs nonfree wireless firmware.

Practical use and configuration choices

Most adopters start with Guix as a foreign-distribution installation to manage development tools or research software, and only later consider Guix System for whole machines. Declarative manifest files describe a profile as code and can be stored in version control next to the project they serve.

SituationRecommended approachReason
Shared server with many usersGuix on a foreign distributionUsers install software without root
Reproducible research pipelineManifest plus pinned channelsTime-machine recreates exact versions
Whole-machine declarative setupGuix SystemServices and users declared in one file
Target hosts without Guix`guix pack` outputShips a self-contained closure
Hardware needing nonfree firmwareThird-party channel or other distributionOfficial channel excludes nonfree code
Choosing a Guix deployment pattern

Limitations and common mistakes

Guix trades simplicity of the file system layout for strong guarantees, and several issues follow from that design.

  • Disk usage grows quickly, because every generation keeps its own dependencies until guix gc runs.
  • `guix pull` can be slow, since it compiles channel code; on small machines it may take many minutes.
  • Missing substitutes force local builds, which can mean hours for large packages such as browsers.
  • Software assuming `/usr/lib` paths may fail; guix shell --container --emulate-fhs helps in such cases.
  • Forgetting environment variables after installation leaves new programs invisible until the profile is sourced again.
  • Grafts apply urgent security fixes without full rebuilds, but they add processing time to some operations.

In simple terms

GNU Guix is a way to install software on Linux that never throws away the previous setup. Every program is kept in its own labeled box, and the label is calculated from everything used to make it. Two versions of the same program can therefore sit side by side without clashing.

When you install or upgrade something, Guix prepares a new arrangement of boxes and switches to it in one step. If the new arrangement causes trouble, you simply switch back to the old one. It works much like an undo button for your whole software collection.

A practical example

A bioinformatics group runs a genome analysis pipeline on a shared university cluster where researchers have no root access. The administrator installs Guix once, and each researcher keeps a manifest file listing tools such as Python, R and several aligners in the same Git repository as the analysis scripts.

Before submitting a paper, the team runs guix describe and stores the exact channel commits with the manifest. Eighteen months later, a reviewer asks for a rerun on new data. Using guix time-machine with the recorded commits, a new student rebuilds the identical software environment, mostly from substitutes, in under an hour. The results match the original figures, and the group avoids weeks of reconstructing library versions by hand.