You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
pjotrp 464f5e56bc notes 4 weeks ago
blogs Started on BLOG draft 1 year ago
images Adding figures in repo 1 year ago
packages 4store: SPARQL 3 years ago
proposals FOSDEM 2020 9 months ago
scripts Guix on other distro 4 years ago
.gitignore ignores 5 years ago
ARVADOS.org Arvados 3 years ago
BIOINFORMATICS.org Suggestion Ludo 5 years ago
CHANNELS.org Channels 5 months ago
CONDA.org CONDA 3 years ago
CONTAINERS.org CWL 1 year ago
DEPLOY.org Deploy 5 months ago
DEVELOPERS.org Updated build instructions 2 years ago
DISTRIBUTE.org CONDA 3 years ago
DLANG.org Hacking D 1 year ago
ELIXIR.org Notes 4 years ago
GEMMA.org Rescue 2 years ago
GUIX-NO-ROOT.org Notes 2 years ago
GUIX-RESCUE.org Rescue 2 years ago
GUIX-SIMPLE-PACKAGE.org Simple 1 year ago
GuixSD.org Guix on other distro 4 years ago
HACKING.org locales 3 months ago
INSTALL.org notes 4 weeks ago
LICENSE.txt LICENSE 5 years ago
OTHER_DISTRO.org fix typos 3 years ago
PYTHON.md Rename PYTHON to PYTHON.md 3 years ago
PYTHON.org Updating CWL 1 year ago
R.org Installing R packages 7 months ago
RACKET.org Racket 1 month ago
README.md Notes on guix pull 3 years ago
REPRODUCIBLE.org Updating reproducible 1 year ago
RUBY-NOKOGIRI.org Mods 4 years ago
RUBY.org fix typos 3 years ago
RUBYGEMS-Nokogiri.org fix typos 3 years ago
SERVICES.org Services 1 year ago
SYSCONFIG.org Updating REPRODUCIBLE 1 year ago
TROUBLESHOOTING.org Tip 4 years ago
WORKFLOW.md Added acknowledgements 1 year ago
WORKFLOW.org Conversion 1 year ago
python2-virtualenv.png image 4 years ago
python2-virtualenv.svg graph 4 years ago

README.md

Introduction

Want to get rid of Ruby RVM and/or have a controlled Python environment? These documents tell you how. The Guix solution is simple and at the same time robust.

Unlike apt, rpm, modules, Brew and Docker, GNU Guix allows you deploy software in a reproducible way and have full control over the dependency graph. You can run multiple versions of the same software (say Ruby 1.8.7, 2.1.1 and 2.3.0) with their fixated dependencies and no interference.

The software graph is getting increasingly complex over time. GNU Guix is the one solution that can handle that complexity. Rather than going for ad hoc solutions, such as Docker and Brew, we champion using the right tool for the job.

alt text

Dependency graph for python2-virtualenv. Notice perl5 is required because of openssl.

Useful Guix commands

This is a list of useful Guix commands. The quick path to installation is using the binary tarball.

Add the guix PATH

export PATH=./guix-profile/bin:$PATH

Start the daemon (normally as root)

guix-daemon --build-users-group=guixbuild

Update guix itself

guix package -i guix

List all recommended environment settings

guix package --search-paths

List all python packages (that contain the word ‘python’)

guix package -A python

Install a version of python using a profile

guix package -p ~/opt/python-2.7.11 -i python@2.7.11

Now you can run this specific version of Python with

~/opt/python-2.7.11/bin/python -V

Such profiles can be shared with other users on the system!

Show the contents of a package

guix package --show=python2-virtualenv

Install Python2 with virtualenv (yes, you can do that)

guix package -i python2-virtualenv

which installs the binary distribution. If you want to build from source do

guix package -i python2-virtualenv --no-substitutes

and if you want to keep the build directories (so to visit them and see what is happening, especially on error)

guix package -i python2-virtualenv --no-substitutes -K

Find all dependencies

guix gc --references /gnu/store/b896978pyr8bfw5bbqv1d7w24163xpxg-python2-virtualenv-13.1.2

Plot a graph of dependencies

guix package -i graphviz
guix graph --type=references python2-virtualenv |dot -Gsize="10,10" -Gratio=0.7 -Tsvg -Nfontsize=48 > dag.svg

Rendering the figure above.

Validate the contents of the store against the database (there is also an option for repair)

guix gc --verify

List all unused paths (i.e., no longer symlinked) and after remove them

guix gc --list-dead
guix gc --collect-garbage

Spawns a shell or container (similar to Docker) where all declared inputs are available and all environment variables are set

guix environment --{pure,container} pkg

Other information

This repository contains Pjotr’s notes on working with GNU Guix. I have gathered install and ‘bootstrapping’ Guix, hacking Guix packages with Guile and the philosophy of creating a Ruby environment and getting rid of RVM, bundler, virtualenv and the like.

You may want to also read Ricardo’s article about Guix on compute clusters and Malcolm’s guide.

Enjoy!

Pjotr Prins