Ivory Siege Tower

mobile construct built of thoughts and parentheses

Adventures in the GuixLand #4: Stumping Interlude

[2023-06-05]

asdf guix lisp st_dev stumpwm

As a form of shocking therapy after wonderful holidays (in order to faster get me into working stance, of course) I chose to solve a couple of annoying problems in my Foreign-Distro-Guix-Setup (1).

First to be solved was the failure of Guix to find installed locale on a foreign Linux distribution. This turned out to be a known issue, and a fix by Andrew Tropin released the pain in my back. Andrew is a contributor to Guix and the author of RDE, a prominent "Doom Emacs of Guix" as he himself pictures his project. Although my own setup is not by far that ambitious (nor is it meant to be), I need to spend some time studying his configuration files - perhaps, by the time I finally dedicate a spare old machine to host an instance of GuixOS.

The second and more important deed was to make StumpWM great work again. In particular my problem was that ASDF when called within Stump image (upon loading my .stumpwmrc) could not find the installed contrib modules, while inside SBCL everything was alright. Yes, stumpwm, its contrib modules and sbcl as well all were installed as Guix packages, since one of the very reason to use Guix is to keep all that zoo automatically in sync!

The solution I found is a bit strange. Part of it is to use the "new" ASDF configuration approach to make discoverable SBCL packages that are not stumpwm-contrib modules, by placing a .conf-file in the ~/.config/common-lisp/source-registry.conf.d/. In my config that is required only to load slynk, and therefore may be omitted by installing stumpwm-with-slynk instead of plain stumpwm.

And then I define custom module loader as following:

  (defvar guix-sbcl-path 
    (format nil "~A/.guix-profile/share/common-lisp/sbcl" 
            (uiop:getenv "HOME"))
    "Location of CL packages obtained with Guix.")

  (defmacro load-guixified-module (name &optional package-name)
    "Allows to load StumpWM contrib modules installed via Guix."
    `(run-commands ,(format nil "add-to-load-path ~A/stumpwm-~A/" guix-sbcl-path name)
                   ,(format nil "load-module ~A" (or package-name name))))

When just calling #'add-to-load-path within rc-file for a package path in ./guix-profile it will be used literally, and errors similar to "ASDF not being able to compile package inside read-only file system" would occur. Same happens if calling directly #'asdf:load-system.

Somehow, when done as above through #'run-commands, these paths (that are actually symlinks!) will be resolved as actual paths inside Guix store - and Stump is able to load those.

I've reworked and even shortened my StumpWM Literate Config, disposing of part of the mode-line enhancements. The Mate Desktop Environment is quite nice actually, and I think I'll be mostly running it by launching mate-session from inside StumpWM. In such a way I enjoy a well-maintained DE with highly customize-able Stump's shortcuts and window tiling on top. However, I also leave an option of "minimalistic" default StumpWM session. And an opportunity to distribute a consistent desktop setup with Guix.


(1) Org-Roam-as-Conf-Source-for-Foreign-Distro-Guix-Setup, to be precise.

Social Timeline: