I first heard about Guix from friends on a discord, the declarative configuration that is a full fledged programming language greatly appealed to me.

So I decided to give it a try, watched some videos from SystemCrafters and read some pages in the manual and I was good to go.

Note that guix is both a system and a package manager, I’ll mostly talk about the system in this short post.

Installation

It’s straightforward the only pain point is that guix has a very strong stance on software freedom and as such it won’t include the blobs necessary for you wifi to work.

That would have been a deal breaker if there was not an easy to use iso with the full kernel, thanks to David.

Now one thing to note on the speed of the download/install package cycles is that it feels a lot slower on guix compared to your average distro, if you don’t have an SSD this will be very painful.

Note that as of 2023 there is no equivalent of preseed for guix, only shell scripts to automate it.

Daily usage

So far if you followed the manual you should get a basic environment with X up and running.

Learning scheme

Now what about actually deviating from the default? what about adding new services and packages? Mass producing os-definition so that you can guix system image them and deploy on libvirt?

Well in order to do that you really need to learn scheme(the guile dialect to be more precise) there is no way around that.

Depending on your background you will have to write a few programs before getting the hang of it and feel confortable in guix, git clone the source code of guix, take a little stroll in it.

But once you have it will feels incredible to not be bound by a DSL.

See Scheme primer for more info

Learning how to actually use the system

You ’ll learn mostly by spending time on it.

The commands that I run most often are

guix pull to download new definitions of packages and services

guix system reconfigure to update the system

guix home reconfigure to update my home services

and finally I have a wrapper that update all extra-profiles that I have in my dotfiles directory.

One thing that is annoying is that guix will sometimes try to compile humonguous packages like qt,firefox,libreoffice… and your only options to avoid that are basically setting the version of the software you want to an inferior version.

Or check with guix weather before reconfiguring the system.

You could have your own build farm too I guess.

How to use steam? How to webdev? Where is my favorite package?

Well…. you will have to use nonguix that is a channel containing some non free software.

Now what if your package/service is not in there? Well you could try search over the internet for a channel that has what you want but you will most likely either:

  1. Package it yourself, depending on the package it can be too time consuming or dead simple.

    Now there are importers to ease the process of packaging but they are not magic, sometimes they just don’t work.

    And even if they are working if your package is non trivial you will most likely have to do some manual stuff.

  2. Download the binary, and if it has dynamic dependencies you will have to patch them, here is a small snippet that was used to run tor-browser

    Found it in nonguix I believe

    cd Browser
    guix shell --check --pure --expression='(list (@@ (gnu packages gcc) gcc) "lib")' coreutils bash grep sed gcc-toolchain patchelf gtk+ dbus-glib libxt libevent openssl@1.1.1l glibc
    patchelf --set-interpreter $LIBRARY_PATH/ld-linux-x86-64.so.2 firefox.real
    patchelf --set-interpreter $LIBRARY_PATH/ld-linux-x86-64.so.2 updater
    patchelf --set-interpreter $LIBRARY_PATH/ld-linux-x86-64.so.2 TorBrowser/Tor/tor
    LD_LIBRARY_PATH=$LIBRARY_PATH ./start-tor-browser
    
  3. Just give up and use your language package manager to install the package locally inside some foler.

So yeah that takes much more time than a simple apt update and apt install package

Get help

The official IRC channel is at #guix on libera.chat people are pretty friendly there.

Other options are the mailing-list help-guix and guix-devel comes to mind.

I know that SystemCrafters has a discord and they do talk about guix in it.

See this list for more resources

The rest are random blog post like this one, github gists.

So all in all not that much places compared to say debian.

Guix is fat

Over time you’ll notice that the store just keeps getting larger and larger you will need garbage collect every once in a while.

Every time you update the system with a reconfigure that makes a new generation.

From what I heard it’s a bit better with btrfs as there is transparent compression in that file system.

Breaking Guix

You do have to watch out for filesystem corruptions, I had one of these happens to some packages in the store and I could not delete it even with the force option of the guix gc.

The result was that I could not use the package IIRC.

If anyone has more details on what to do in these cases?

Also see chrooting into existing system if you like me managed to break grub a few times.

Conclusion

I think Guix has very solid foundations and it makes ansible & co feels prehistoric note that I feel like I haven’t talk enough about all the things can do for you so I will do a short summary here.

  1. Can actually be used to manage other guix systems with guix deploy eliminating the need for ansible.

  2. Manage your dotfiles in a manner that is reproducible with guix home see rde from Andrew Tropin that demonstrates its full power.

  3. If you managed to package stuff in guix, you can export it in .deb,.rpm format or even a docker, pretty neat right?

  4. You can actually transfer some elements of the store into another guix machine, and you can offload the build of big packages like Qt to a remote guix(note that this only concerns some part IIRC you will still needs to build derivation,profile? on the local)

  5. Have a completely isolated environment, here is a short snippet of mine that contains emacs and some dependencies specified in manifests.

    guix shell --network --container \
         --pure --emulate-fhs --no-cwd \
         --preserve="^DISPLAY$" \
         --share="/home/user/.config/emacs" \
         --share="/home/user/projects/kimsufi-infra/pulumi-state/" \
         --share="/home/user/projects/kimsufi-infra/pulumi" \
         coreutils emacs font-fira-code fontconfig nss-certs bash openssh \
         -m /home/user/dotfiles/guix/manifests/emacs.scm \
         -m /home/user/dotfiles/guix/manifests/devops.scm \
         -m /home/user/dotfiles/guix/manifests/python.scm \
         -m /home/user/dotfiles/guix/manifests/coding.scm
    

However every pain points revolve around the fact that guix is niche and there is not that much people that are available to review the patches, contribute to the core, add packages, write nice documentation with concrete examples.

Despite this I would recommend you to give it a try if you are willing to spend the time.

Now how much time are we talking about exactly?

Well depending on your background (I will assume 0 functionnal programming, nor nix experience just debian/arch experience) you basically have to learn a new language + a new system + the mailling-list workflow + irc setup (most people use discord these days) + read the source code to know why stuff does not works/works.

That’s actually a pretty huge time investment especially the mailing list and the irc, you have to be very proactive whereas if it was a more mainstream distro like debian you could just follow a blog post/stack overflow, copy paste some instructions with a few changes and boom that works.

Or just download a package and forget about the whole reproducibility crisis.