Commit 33f04422 authored by Ambrevar's avatar Ambrevar

guix-profiles: Add section on how to set up reproducible profiles.

parent b8a557be
......@@ -14,7 +14,8 @@ on a same system are free to use as many profiles as they want.
If you are familiar with Python's =virtualenv=, you can think of a profile as a
kind of universal =virtualenv= that can hold any kind of software whatsoever, not
just Python software. Furthermore, profiles are self-sufficient: they capture
all the runtime dependencies.
all the runtime dependencies which guarantees that all programs within a profile
will always work at any point in time.
Multiple profiles have many benefits:
......@@ -36,7 +37,7 @@ Multiple profiles have many benefits:
- Reproducible: when used with declarative manifests, a profile can be fully
specified by the Guix commit that was active when it was set up. This means
that the exact same profile can be [[https://guix.gnu.org/blog/2018/multi-dimensional-transactions-and-rollbacks-oh-my/][set up anywhere, anytime]], with just the
commit information.
commit information. See the section on [[Reproducible profiles]].
- Easier upgrades and maintenance: Multiple profiles make it easy to keep
package listings at hand and make upgrades completely friction-less.
......@@ -50,7 +51,7 @@ Concretely, here follows some typical profiles:
- Laptop-specific programs (like =powertop=) that you don't need on a desktop.
- TeXlive (this one can be really useful when you need to install just one
package for the next document you've received over email).
package for this one document you've just received over email).
- Games.
......@@ -210,11 +211,11 @@ usability.
Manifests come with multiple benefits. In particular, they ease maintenance:
- When a profile is set up from a manifest, the manifest itself is
self-sufficient to keep a "package listing" around and reproduce the profile
later or on a different system. For ad-hoc profiles, we would need to
generate a manifest specification manually and maintain the package versions
for the packages that don't use the default version.
- Given a specific Guix version, when a profile is set up from a manifest, the
manifest itself is self-sufficient to keep a "package listing" around and
reproduce the profile later or on a different system. For ad-hoc profiles, we
would need to generate a manifest specification manually and maintain the
package versions for the packages that don't use the default version.
- ~guix package --upgrade~ always tries to update the packages that have
propagated inputs, even if there is nothing to do. Guix manifests remove this
......@@ -268,9 +269,40 @@ hacking environment will be available at all times.
/Security warning:/ While keeping old profiles around can be convenient, note
that outdated packages may not have received the latest security fixes.
* Reproducible profiles
To reproduce a profile, we need two pieces of information:
- a manifest,
- a Guix channel specification.
Indeed, manifests alone might not be enough: different Guix versions (or
different channels) can produce different outputs for a given manifest.
You can output the Guix channel specification with =guix describe
--format=channels=.
Save this to a file, say =channel-specs.scm=.
On another computer, you can use the channel specification file and the manifest
to recreate the exact same profile:
#+begin_src sh
GUIX_EXTRA_PROFILES=$HOME/.guix-extra-profiles
GUIX_EXTRA=$HOME/.guix-extra
mkdir "$GUIX_EXTRA"/my-project
guix pull --channels=channel-specs.scm --profile "$GUIX_EXTRA/my-project/guix"
mkdir -p "$GUIX_EXTRA_PROFILES/my-project"
"$GUIX_EXTRA"/my-project/guix/bin/guix package --manifest=/path/to/guix-my-project-manifest.scm --profile="$GUIX_EXTRA_PROFILES"/my-project/my-project
#+end_src
It's safe to delete the Guix channel profile you've just installed, the project
profile does not depend on it.
* Special thanks
Chris Marusich for his thorough feedback.
Chris Marusich and Simon Tournier for their thorough feedback.
* About GNU Guix
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment