Guix
Three things I’ve been up to coalesced last month - Nix, Emacs, and buying a new laptop. Ultimately my laptop ended up running Fedora Kinoite, but these notes might be useful to others, or to myself in the future.
Nix ended up being a dead-end for me. I’m not going to ramble about my issues with it - but they had nothing to do with the perennial blood-sport that community seems to engage in.
Emacs is something I’ve been refamiliarising myself with. I never stopped using Emacs, nor my Emacs 22 reference mug - but outside of simple editing I didn’t touch it much. After a friend asked about emacs, I got back on the wagon. Lots of exploring packages, going through a few advent-of-code days in Elisp, and uncovering forgotten memories of key chords in the process.
Anyway - after deciding to buy a new laptop, I had to pick a distribution. The issues I had with Nix weren’t around its goals, so I thought to try Guix.
Installing Guix
Installing Guix is a ball-ache. The FSF’s Respects Your Freedom hardware list is bereft of laptops. Right now there are only two listed, and both are on the theme of the Thinkpad X200 (which I do actually have, and used throughout university).
Putting together a contemporary laptop with components that don’t require blobs is only getting harder - blobless 802.11ac doesn’t exist, nor 802.11ax. The only practical choice for Wifi on an m.2 slot is a 2x2 Qualcomm Atheros card that runs on ath9k. GPU acceleration remains tied to Intel, but even that seems to be going away with Arc. We are in dark times.
Nontheless, Guix can run without the linux-libre kernel. That’s the aformentioned ball-ache. nonguix is a channel that provides a blob-covered Linux kernel, but a handy-dandy installer is (for the moment) out of scope.
The full process I went through is as follows:
Build an installation image
Start by cloning the guix-installer repository. This comes with a handy build-iso.sh script that generates an ISO9660 image. This script doesn’t do more than call guix system in such a way that the nonguix channel and substitutes are added into the final image.
This doesn’t require you run Guix SD (the distribution). In my case I installed Guix onto my Fedora workstation and built it on that.
Perform the installation
With the image dd’d to a USB stick, and booted from, the instructions provided by the installer are straight forward. However you will inevitably notice when asked which kernel you would prefer, your only choices are ‘linux-libre’ and ‘hurd’. The installer, while great, doesn’t know anything about the encumbered kernel we require. Pick linux-libre, and continue until you reach the point you are asked if you would like to edit the generated scheme.
We do. And I have a lot of edits I’d like to make.
config.scm
To ensure you end up with an encumbered kernel, you can follow the steps outlined in the system crafters installation guide. If, like me, you have other changes to make, read on. Else jump past the rest of this section.
In my case, I prefer KDE. But KDE, as you will have noticed, is not currently a supported desktop environment - and this is for a good reason, it’s a buggy experience! Nonetheless, the packages and code needed to run a KDE desktop are available. So we pull them in:
;; We need the remove function, so pull in SRFI-1
(use-modules (srfi srfi-1))
;; We're going to use SDDM instead of GDM
(use-service-modules cups desktop sddm networking ssh xorg nfs)
;;[snip]
;; And we're going to depend on plasma-desktop-service-type to pull in plasma-desktop
(services
(append
(list
;; plasma
(service plasma-desktop-service-type)
(service sddm-service-type (sddm-configuration (theme "breeze")))
;; system services
(service cups-service-type)
(service openssh-service-type)
(service nfs-service-type (nfs-configuration)))
;; We can either specify all the other services out desktop needs,
;; or modify %desktop-services to exclude service-types that conflict.
;; In our case, that being the gdm-service-type.
(remove (lambda (service)
(memq (service-kind service)
(list gdm-service-type sddm-service-type)))
%desktop-services)))
Finishing the installation
From this point on, the steps are just as outlined in the installation guide linked above. While the guide recommends “Don’t use your system.scm to install packages you want to use day to day, use guix install instead!” – I’m not inclined to follow that suggestion to the letter.
It is a sensible recommendation. But as I use very few packages, all of which have substitutes available, and update sparingly - it’s far more convenient to simply list them out and update everything in one go.
Of course, if you’re pulling down a lot (or large projects like LLVM), then don’t stick that in your config.scm because someone needs to pay for the transit you’ll be occupying!
Next Steps, some day
There’s a few packages I’d like to see added to Guix. sngrep for one. Wargus is another. The former shouldn’t be difficult. The latter I’m aware has a dependency on an abandoned lua project, so that may be harder.