Next: , Previous: , Up: Package Management   [Contents][Index]


3.7 Invoking guix pack

Occasionally you want to pass software to people who are not (yet!) lucky enough to be using Guix. You’d tell them to run guix package -i something, but that’s not possible in this case. This is where guix pack comes in.

The guix pack command creates a shrink-wrapped pack or software bundle: it creates a tarball or some other archive containing the binaries of the software you’re interested in, and all its dependencies. The resulting archive can be used on any machine that does not have Guix, and people can run the exact same binaries as those you have with Guix. The pack itself is created in a bit-reproducible fashion, so anyone can verify that it really contains the build results that you pretend to be shipping.

For example, to create a bundle containing Guile, Emacs, Geiser, and all their dependencies, you can run:

$ guix pack guile emacs geiser
…
/gnu/store/…-pack.tar.gz

The result here is a tarball containing a /gnu/store directory with all the relevant packages. The resulting tarball contains a profile with the three packages of interest; the profile is the same as would be created by guix package -i. It is this mechanism that is used to create Guix’s own standalone binary tarball (see Binary Installation).

Users of this pack would have to run /gnu/store/…-profile/bin/guile to run Guile, which you may find inconvenient. To work around it, you can create, say, a /opt/gnu/bin symlink to the profile:

guix pack -S /opt/gnu/bin=bin guile emacs geiser

That way, users can happily type /opt/gnu/bin/guile and enjoy.

Alternatively, you can produce a pack in the Docker image format using the following command:

guix pack -f docker guile emacs geiser

The result is a tarball that can be passed to the docker load command. See the Docker documentation for more information.

Several command-line options allow you to customize your pack:

--format=format
-f format

Produce a pack in the given format.

The available formats are:

tarball

This is the default format. It produces a tarball containing all the specifies binaries and symlinks.

docker

This produces a tarball that follows the Docker Image Specification.

--expression=expr
-e expr

Consider the package expr evaluates to.

This has the same purpose as the same-named option in guix build (see --expression in guix build).

--system=system
-s system

Attempt to build for system—e.g., i686-linux—instead of the system type of the build host.

--target=triplet

Cross-build for triplet, which must be a valid GNU triplet, such as "mips64el-linux-gnu" (see GNU configuration triplets in Autoconf).

--compression=tool
-C tool

Compress the resulting tarball using tool—one of gzip, bzip2, xz, or lzip.

--symlink=spec
-S spec

Add the symlinks specified by spec to the pack. This option can appear several times.

spec has the form source=target, where source is the symlink that will be created and target is the symlink target.

For instance, -S /opt/gnu/bin=bin creates a /opt/gnu/bin symlink pointing to the bin sub-directory of the profile.

--localstatedir

Include the “local state directory”, /var/guix, in the resulting pack.

/var/guix contains the store database (see The Store) as well as garbage-collector roots (see Invoking guix gc). Providing it in the pack means that the store is “complete” and manageable by Guix; not providing it pack means that the store is “dead”: items cannot be added to it or removed from it after extraction of the pack.

One use case for this is the Guix self-contained binary tarball (see Binary Installation).

In addition, guix pack supports all the common build options (see Common Build Options) and all the package transformation options (see Package Transformation Options).


Next: , Previous: , Up: Package Management   [Contents][Index]