So you get excited when you hear about surviving a power-outage during updates without a hitch [1] and you want to give Guix [2] a try — but woes, you only have 5 minutes of time?
Fear not, that’s enough to get it up and running — all the way to per-user environments and package install as non-priviledged user!
The instructions here are from the official docs [3], specialized for a GNU Linux host and cut to what I need in a working system.
as user:
$ cd /tmp
$ wget ftp://alpha.gnu.org/gnu/guix/guix-binary-0.8.3.x86_64-linux.tar.xz
become root
$ sudo screen
unpack install and setup Guix
# tar xf guix-binary-0.8.3.x86_64-linux.tar.xz
# mv var/guix /var/ && mv gnu /
# ln -sf /var/guix/profiles/per-user/root/guix-profile ~root/.guix-profile
Create the build users as per Build-Environment-Setup [4]:
# groupadd --system guixbuild
# for i in `seq -w 1 10`;
do
useradd -g guixbuild -G guixbuild \
-d /var/empty -s `which nologin` \
-c "Guix build user $i" --system \
guixbuilder$i;
done
Run the daemon:
# ~root/.guix-profile/bin/guix-daemon --build-users-group=guixbuild
Switch to a second root window with CTRL-a c
to adjust the PATH, allow substitutes from the Hydra build server, and to install and set locales [5] (required since we’re installing an overlay, not a full distro).
# echo 'PATH="$HOME/.guix-profile/bin:$HOME/.guix-profile/sbin:${PATH}"' >> $HOME/.bashrc
# echo 'export LOCPATH=$HOME/.guix-profile/lib/locale' >> $HOME/.bashrc
# source $HOME/.bashrc
# guix archive --authorize < ~root/.guix-profile/share/guix/hydra.gnu.org.pub
# guix package -i glibc-utf8-locales
Allow all users to use the guix command (as long as guix-daemon is running):
# mkdir -p /usr/local/bin
# cd /usr/local/bin
# ln -s /var/guix/profiles/per-user/root/guix-profile/bin/guix
Switch back to your regular user and provide the guix profile. Also install the locales (remember that the installation is really per-user, though the users share packages if they install them both). The per-user profile will be generated the first time you run guix package
.
$ ln -sf /var/guix/profiles/per-user/$(whoami)/guix-profile ~/.guix-profile
$ echo 'export PATH="$HOME/.guix-profile/bin:$HOME/.guix-profile/sbin:${PATH}"' >> $HOME/.bashrc
$ echo 'export LOCPATH=$HOME/.guix-profile/lib/locale' >> $HOME/.bashrc
$ source $HOME/.bashrc
$ guix package -i glibc-utf8-locales
And now:
$ guix package -i guile-emacs --fallback
$ ~/.guix-profile/bin/emacs -Q
So you believed that only a pipe-dream, just like power-loss-resistant updates and functional packaging using the official GNU extension language [6]? I was glad to be proven wrong, and I hope you’ll feel the same ☺ (though guile-emacs [7] is still experimental it already allows calling elisp functions directly from scheme)
Happy Hacking!
Links:
[1] http://www.xn--drachentrnen-ocb.de/light/english/install-gnu-guix-03
[2] http://gnu.org/s/guix
[3] https://www.gnu.org/software/guix/manual/en/guix.html#Binary-Installation
[4] http://www.gnu.org/software/guix/manual/guix.html#Build-Environment-Setup
[5] http://www.gnu.org/software/guix/manual/guix.html#Application-Setup
[6] http://gnu.org/s/guile
[7] http://emacswiki.org/emacs/GuileEmacs