Stumpwm: how to use contrib modules?

Any stumpwm users out there? I’m trying using the nixos stumpwm module, and I’m having trouble figuring out how to get various lisp dependencies available at runtime such that it’s possible to use some modules from stumpwm-contrib. In particular I want to use ttf-fonts, which depends on clx-truetype, but that’s not findable at runtime.

I’m new to the Common Lisp ecosystem so I have very little clue what I’m doing when it comes to quicklisp, especially as it pertains to Nix.

So far I’ve tried adding clx-truetype as a dependency to stumpwm in its build, like so:

diff --git a/pkgs/development/lisp-modules/quicklisp-to-nix-output/stumpwm.nix b/pkgs/development/lisp-modules/quicklisp-to-nix-output/stumpwm.nix
index bb39c74c962..a9c7bb67c41 100644
--- a/pkgs/development/lisp-modules/quicklisp-to-nix-output/stumpwm.nix
+++ b/pkgs/development/lisp-modules/quicklisp-to-nix-output/stumpwm.nix
@@ -5,7 +5,7 @@ rec {
 
   description = ''A tiling, keyboard driven window manager'';
 
-  deps = [ args."alexandria" args."cl-ppcre" args."clx" ];
+  deps = [ args."alexandria" args."cl-ppcre" args."clx" args."clx-truetype" ];
 
   src = fetchurl {
     url = ''http://beta.quicklisp.org/archive/stumpwm/2018-08-31/stumpwm-20180831-git.tgz'';
diff --git a/pkgs/development/lisp-modules/quicklisp-to-nix.nix b/pkgs/development/lisp-modules/quicklisp-to-nix.nix
index 8a126d4fd98..84a82c6e238 100644
--- a/pkgs/development/lisp-modules/quicklisp-to-nix.nix
+++ b/pkgs/development/lisp-modules/quicklisp-to-nix.nix
@@ -1045,6 +1045,7 @@ let quicklisp-to-nix-packages = rec {
            "alexandria" = quicklisp-to-nix-packages."alexandria";
            "cl-ppcre" = quicklisp-to-nix-packages."cl-ppcre";
            "clx" = quicklisp-to-nix-packages."clx";
+           "clx-truetype" = quicklisp-to-nix-packages."clx-truetype";
        }));

…but to no avail; (load-module "ttf-fonts") still fails with the usual error complaining about #:CLX-TRUETYPE:

Component #:CLX-TRUETYPE not found, required by #<SYSTEM "ttf-fonts">Backtrace for: #<SB-THREAD:THREAD "main thread" RUNNING {10056F0373}>
0: (STUMPWM::BACKTRACE-STRING)
1: (ERR "~A" Component #:CLX-TRUETYPE not found, required by #<SYSTEM "ttf-fonts">)
2: (EVAL-LINE "(load-module \"ttf-fonts\")")

(error output trimmed for brevity)

I’ve also noticed that stumpwm starts up with *module-dir* set to #P"/build/.temp--home/.stumpwm.d/modules/", which must be an artifact of the build process. I can override that in my stumpwmrc, to point at my own homedir, but perhaps there’s a way to bake in a better default?

Any stumpwm users out there? I’m trying using the nixos stumpwm module, and I’m having trouble figuring out how to get various lisp dependencies available at runtime such that it’s possible to use some modules from stumpwm-contrib. In particular I want to use ttf-fonts, which depends on clx-truetype, but that’s not findable at runtime.

I’m new to the Common Lisp ecosystem so I have very little clue what I’m doing when it comes to quicklisp, especially as it pertains to Nix.

I use Nixpkgs StumpWM but not NixOS, and I just use (an equivalent of)

nix-shell -I /home/repos/ -p lispPackages.stumpwm -p lispPackages.clx-truetype --run “cl-wrapper.sh sbcl --eval ‘(require :stumpwm)’ --eval ‘(stumpwm:stumpwm)’ --eval ‘(quit)’”

I am unsure if there is a simple and reliable way to control StumpWM build process w.r.t. search paths after launch.

You can also set CL_SOURCE_REGISTRY of the service to include all the needed dependencies — but you need many paths, as listed in
/nix/store/…-lisp-clx-truetype-…-git/lib/common-lisp-settings/clx-truetype-path-config.sh

(The variable is set in the format for cl-wrapper.sh, CL_SOURCE_REGISTRY expects a colon-separated list)

1 Like