
<feed xmlns="http://www.w3.org/2005/Atom">
    <generator>Hugo -- gohugo.io</generator>
    <title>
                guix on
            
        
        The Neo-Babbage Files</title>
        <link href="https://babbagefiles.xyz/categories/guix/atom.xml" rel="self" type="application/atom+xml" /><link href="https://babbagefiles.xyz/categories/guix/"/>
    <updated>2025-12-29T11:00:32+00:00</updated>
    <author>
            <name>Benjamin Slade</name>
            
                <email>slade@lambda-y.net</email>
            </author>
    <id>https://babbagefiles.xyz/categories/guix/</id>
        
        <entry>
            <title type="html"><![CDATA[Guix, XIM, Emacs, Multi_key, Shft+SPC]]></title>
            <link href="https://babbagefiles.xyz/guix-xim-emacs-multikey-shft-spc/"/>
            <id>https://babbagefiles.xyz/guix-xim-emacs-multikey-shft-spc/</id>
            
                    <author>
                        <name>Benjamin Slade</name>
                    </author>
            <published>2025-01-30T12:22:00-06:00</published>
            <updated>2025-12-21T22:01:03-06:00</updated>
            
            
            <content type="html"><![CDATA[<blockquote>
<p>— Describe in single words only the good things that come into your mind
about&hellip; <code>&lt;Multi_key&gt;</code>.</p>
<p>— <code>&lt;Multi_key&gt;</code>?</p>
<p>— Yeah.</p>
<p>— Let me tell you about <code>&lt;Multi_key&gt;</code>&hellip;.</p>
<p><code>&quot;&lt;Multi_key&gt; is undefined&quot;</code></p>
</blockquote>
<p>A bit out of order, but things tangle, a problem I&rsquo;m having on my Guix
machine with Emacs.</p>
<p>It&rsquo;s connected with the Lucid toolkit<sup id="fnref:1"><a href="#fn:1" class="footnote-ref" role="doc-noteref">1</a></sup>, but only in an
indirect causal sort of way:— I&rsquo;m using the standard GTK3 toolkit on
this particular build of Emacs on Guix. (A custom build, admittedly,
which might be part of the issue, but where exactly, I&rsquo;m not sure.)
I&rsquo;ll probably say some other things connected to this later, but for
the moment forget about Lucid. It&rsquo;s just a GTK3 toolkit build.<sup id="fnref:2"><a href="#fn:2" class="footnote-ref" role="doc-noteref">2</a></sup></p>
<p>So, skipping over large swathes of story, I&rsquo;ve got a seemingly
mostly-functioning build of Emacs 30.0.93 running on my Guix laptop
(which finally has a functioning StumpWM environment again), and I go
to type <em>æ</em> or <em>þ</em> or <em>á</em> or <em>λ</em> or something using <code>Right_Alt</code> as a compose key
(defined by <code>xmodmap</code>) and Emacs, without blinking an eye, flashes at
me, saying <code>&quot;&lt;Multi_key&gt; is undefined&quot;</code>.</p>
<p>I try various things to do with <a href="https://en.wikipedia.org/wiki/X_Input_Method">XIM</a> and environment variables<sup id="fnref:3"><a href="#fn:3" class="footnote-ref" role="doc-noteref">3</a></sup> and
none of it works. I finally come across a post on a FreeBSD bugs
tracker<sup id="fnref:4"><a href="#fn:4" class="footnote-ref" role="doc-noteref">4</a></sup> which suggests a possible fix of setting <code>(setq x-gtk-use-native-input 't)</code>.</p>
<p>And, though it feels like a hack for something that&rsquo;s gone wrong in a
deeper way, it seems to work, and I can type <em>ɔ</em> and <em>Þ</em> and <em>γ</em> and so
on.</p>
<p>But then I&rsquo;m reading a PDF (using <a href="https://github.com/vedang/pdf-tools">PDF Tools</a>) and I go to page back up
to read an earlier bit by pressing Shift and SPACE and I find myself
paging down to the end of the document instead.</p>
<p>The &ldquo;native input&rdquo; method apparently won&rsquo;t recognise Shft+SPACE, but
just sees SPACE and so pages down.</p>
<p>So if <code>x-gtk-use-native-input</code> is <code>nil</code>, I can&rsquo;t use the compose key in
Emacs, and if it&rsquo;s <code>t</code> then I can&rsquo;t scroll properly in PDFs.</p>
<p>I thought vaguely about writing a macro to process the <a href="https://github.com/kragen/xcompose/">&lsquo;kragen&rsquo; XCompose
definitions</a> into a bunch of things of the form:</p>
<div class="highlight"><pre class="chroma"><code class="language-elisp" data-lang="elisp"><span class="p">(</span><span class="nf">define-key</span> <span class="nv">global-map</span> <span class="p">[(</span><span class="nv">Multi_key</span><span class="p">)</span> <span class="p">(</span><span class="nv">s</span><span class="p">)</span> <span class="p">(</span><span class="nv">s</span><span class="p">)]</span> <span class="p">(</span><span class="nb">lambda</span> <span class="p">()</span>
                                                   <span class="p">(</span><span class="nb">interactive</span><span class="p">)</span>
                                                 <span class="p">(</span><span class="nf">insert</span> <span class="mi">223</span><span class="p">)))</span>
</code></pre></div><p>and then have my init.el load the whole thing in. But I don&rsquo;t think
that would quite work anyway, since sometimes I want to say insert a special
character as part of a search and not insert it into a text buffer.</p>
<p>So I came up with a different stupid solution. It&rsquo;s not perfect, but
it&rsquo;s at least somewhat working while I try to figure out what went
wrong in the first place.</p>
<p>Here it is:</p>
<div class="highlight"><pre class="chroma"><code class="language-elisp" data-lang="elisp"><span class="p">(</span><span class="nb">when</span> <span class="p">(</span><span class="nf">equal</span> <span class="p">(</span><span class="nf">system-name</span><span class="p">)</span> <span class="s">&#34;guix-laptop&#34;</span><span class="p">)</span>
  <span class="c1">;; on this Guix/StumpWM machine&#39;s Emacs, xcompose doesn&#39;t work:</span>
  <span class="c1">;; Emacs says &#34;I don&#39;t know what &lt;Multi_key&gt; means&#34;</span>
  <span class="c1">;; (well, it actually says &#34;&lt;Multi_key&gt; is undefined&#34;).</span>
  <span class="c1">;; As per https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=278167</span>
  <span class="c1">;; we can &#39;fix&#39; this if we set (setq x-gtk-use-native-input &#39;t).</span>
  <span class="c1">;; Then xcompose will will work again ... but now Shift-SPACE won&#39;t</span>

  <span class="c1">;; So...</span>

  <span class="p">(</span><span class="nb">setq</span> <span class="nv">x-gtk-use-native-input</span> <span class="ss">&#39;nil</span><span class="p">)</span> <span class="c1">;; make sure Shift-SPACE works...</span>

  <span class="c1">;; So, Emacs says &#34;&lt;Multi_key&gt; is undefined&#34;.</span>
  <span class="c1">;; Well, then, we can define it.</span>
  <span class="c1">;; Namely as a function which sets `x-gtk-use-native-input&#39; to `t&#39;,</span>
  <span class="c1">;; and then calls an external shell-command to input &lt;Multi_key&gt;</span>
  <span class="c1">;; (so that it acts like Right_Alt was pressed), and then sets a timer running</span>
  <span class="c1">;; that turns `x-gtk-use-native-input&#39; to `nil&#39; after 10 seconds</span>
  <span class="c1">;; (so that Shift-SPACE will work again).</span>

  <span class="p">(</span><span class="nb">defun</span> <span class="nv">bms/xinput-hack</span> <span class="p">()</span>
    <span class="p">(</span><span class="nb">interactive</span><span class="p">)</span>
    <span class="c1">;; stop the timer if there is one running already:</span>
    <span class="p">(</span><span class="nb">when</span> <span class="nv">bms/xinput-timer-running</span>
      <span class="p">(</span><span class="nv">cancel-timer</span> <span class="nv">bms/xinput-timer-running</span><span class="p">))</span>
    <span class="c1">;; set the input method to allow xcompose to work:</span>
    <span class="p">(</span><span class="nb">setq</span> <span class="nv">x-gtk-use-native-input</span> <span class="ss">&#39;t</span><span class="p">)</span>
    <span class="c1">;; must have `xdotool&#39; installed:</span>
    <span class="p">(</span><span class="nv">shell-command</span> <span class="s">&#34;xdotool key Multi_key&#34;</span><span class="p">)</span>
    <span class="c1">;; record the name of the timer to stop it,</span>
    <span class="c1">;; so we don&#39;t end up with tonnes of timers somehow</span>
    <span class="p">(</span><span class="nb">setq</span> <span class="nv">bms/xinput-timer-running</span>
          <span class="p">(</span><span class="nv">run-at-time</span> <span class="mi">10</span> <span class="no">nil</span>
          <span class="c1">;; this sets it for 10 secs; maybe could be shorter,</span>
          <span class="c1">;; but you don&#39;t want it turning off in the middle of sequences</span>
                       <span class="p">(</span><span class="nb">lambda</span> <span class="p">()</span>
                         <span class="p">(</span><span class="nb">setq</span> <span class="nv">x-gtk-use-native-input</span> <span class="ss">&#39;nil</span><span class="p">)))))</span>

  <span class="c1">;; And then we bind &lt;Multi_key&gt; to that function.</span>
  <span class="c1">;; (There, now it&#39;s not undefined anymore.)</span>

  <span class="p">(</span><span class="nf">define-key</span> <span class="nv">global-map</span> <span class="p">(</span><span class="nv">kbd</span> <span class="s">&#34;&lt;Multi_key&gt;&#34;</span><span class="p">)</span> <span class="nf">#&#39;</span><span class="nv">bms/xinput-hack</span><span class="p">))</span>
  <span class="c1">;; A stupid solution to a stupid problem.</span>
</code></pre></div><section class="footnotes" role="doc-endnotes">
<hr>
<ol>
<li id="fn:1" role="doc-endnote">
<p>See <a href="https://www.reddit.com/r/emacs/comments/1hlj04t/emacs_using_the_lucid_toolkit_is_blazingly_fast/">Emacs Using the Lucid toolkit is blazingly fast |
r/emacs</a> for why this might be interesting. This is the whole &ldquo;out of
order&rdquo; thing, but it&rsquo;s not directly relevant for this particular post. <a href="#fnref:1" class="footnote-backref" role="doc-backlink">&#x21a9;&#xfe0e;</a></p>
</li>
<li id="fn:2" role="doc-endnote">
<p>Though, on the plain, boring, ordinary GTK3 toolkit and its
relation to Emacs see <a href="https://web.archive.org/web/20161115194659/https://www.facebook.com/notes/daniel-colascione/buttery-smooth-emacs/10155313440066102/">&ldquo;Buttery Smooth Emacs&rdquo;</a>. <a href="#fnref:2" class="footnote-backref" role="doc-backlink">&#x21a9;&#xfe0e;</a></p>
</li>
<li id="fn:3" role="doc-endnote">
<p>And I&rsquo;ve already got <code>(setf (getenv &quot;GTK_IM_MODULE&quot;) &quot;xim&quot;)</code>
and <code>(setf (getenv &quot;QT_IM_MODULE&quot;) &quot;xim&quot;</code> setting environment variables
in my <code>init.lisp</code> config for StumpWM here anyway. <a href="#fnref:3" class="footnote-backref" role="doc-backlink">&#x21a9;&#xfe0e;</a></p>
</li>
<li id="fn:4" role="doc-endnote">
<p><a href="https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=278167">https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=278167</a> <a href="#fnref:4" class="footnote-backref" role="doc-backlink">&#x21a9;&#xfe0e;</a></p>
</li>
</ol>
</section>
]]></content>
            
                 
                    
                         
                        
                            
                             
                                <category scheme="https://babbagefiles.xyz/categories/emacs" term="emacs" label="emacs" />
                             
                                <category scheme="https://babbagefiles.xyz/categories/guix" term="guix" label="guix" />
                            
                        
                    
                 
                    
                 
                    
                
            
        </entry>
    
        
        <entry>
            <title type="html"><![CDATA[Dealing with possessed TrackPoints on later model ThinkPads]]></title>
            <link href="https://babbagefiles.xyz/possessed-trackpoint/"/>
            <id>https://babbagefiles.xyz/possessed-trackpoint/</id>
            
                    <author>
                        <name>Benjamin Slade</name>
                    </author>
            <published>2022-06-18T19:51:00-06:00</published>
            <updated>2022-06-18T20:22:51-06:00</updated>
            
            
            <content type="html"><![CDATA[<p>On a new-to-me ThinkPad T440p, I&rsquo;ve had the worst time with the
TrackPoint.</p>
<p>First, the stock configuration has a horrible touchpad -
which shouldn&rsquo;t matter if you don&rsquo;t use the touchpad, but the
horribleness of it is that the physical buttons that should be on the
top of the touchpad, and are on the touchpads of models preceding and
following the **40 line, are not there. But one <a href="https://octoperf.com/blog/2018/11/07/thinkpad-t440p-buyers-guide/#trackpad">can replace it</a>, and so
I did.</p>
<p>The T440p is nice in that servicing the fan and other internals of the
machine is a relatively easy affair compared to say an X230. Just undo
two screws on the bottom of the laptop and slide off the back panel,
and you have access to memory, drives, the CPU, and so on. And so
swapping in a different CPU was really easy and painless.</p>
<p>On the other hand, changing the touchpad was a very involved
affair. But it <a href="https://www.youtube.com/watch?v=7wM4Kqdy3_E">can be done</a>.</p>
<p>However, still the mouse-cursor experience for the machine continued
to be horrible. Firstly, there was significant &ldquo;drift&rdquo; of the
TrackPoint. I.e., even once pressure is released, it keeps moving, for
a long time.</p>
<p>However, this ends up being solvable via</p>
<div class="highlight"><pre class="chroma"><code class="language-shell" data-lang="shell">sudo -s <span class="nb">echo</span>  <span class="s1">&#39;ACTION==&#34;add&#34;,SUBSYSTEM==&#34;input&#34;,ATTR{name}==&#34;TPPS/2 IBM TrackPoint&#34;,ATTR{device/drift_time}=&#34;30&#34;&#39;</span>  &gt; /etc/udev/rules.d/10-trackpoint.rules
</code></pre></div><p>(If you&rsquo;re trying to do this in Guix, something like:</p>
<div class="highlight"><pre class="chroma"><code class="language-scheme" data-lang="scheme"><span class="p">(</span><span class="k">define </span><span class="nv">%trackpoint-drift-rule</span>
  <span class="p">(</span><span class="nf">udev-rule</span>
    <span class="s">&#34;10-trackpoint.rules&#34;</span>
    <span class="p">(</span><span class="nb">string-append </span><span class="s">&#34;ACTION==\&#34;add\&#34;,SUBSYSTEM==\&#34;input\&#34;,ATTR{name}==\&#34;TPPS/2 IBM TrackPoint\&#34;,ATTR{device/drift_time}=\&#34;25\&#34;&#34;</span><span class="p">))</span>
</code></pre></div><div class="highlight"><pre class="chroma"><code class="language-scheme" data-lang="scheme"><span class="p">(</span><span class="k">define </span><span class="nv">%my-desktop-services</span>
   <span class="p">(</span><span class="nb">cons </span><span class="p">(</span><span class="nf">udev-rules-service</span> <span class="ss">&#39;trackpoint-drift</span> <span class="nv">%trackpoint-drift-rule</span><span class="p">)</span>
         <span class="p">(</span><span class="nf">modify-services</span> <span class="nv">%desktop-services</span>
                          <span class="o">....</span><span class="p">)</span> <span class="c1">; other modifications here</span>
         <span class="p">))</span>
</code></pre></div><div class="highlight"><pre class="chroma"><code class="language-scheme" data-lang="scheme"><span class="p">(</span><span class="nf">operating-system</span>
  <span class="o">....</span>
  <span class="p">(</span><span class="nf">services</span>
    <span class="p">(</span><span class="nf">append</span>
     <span class="p">(</span><span class="nf">list</span>
      <span class="p">(</span><span class="nf">service</span> <span class="nv">openssh-service-type</span><span class="p">)</span>
      <span class="p">(</span><span class="nf">service</span> <span class="nv">cups-service-type</span><span class="p">)</span>
      <span class="p">(</span><span class="nf">service</span> <span class="nv">nix-service-type</span><span class="p">)</span>
      <span class="o">....</span><span class="p">)</span>
     <span class="nv">%my-desktop-services</span><span class="p">))</span>
  <span class="o">....</span><span class="p">)</span>
</code></pre></div><p>instead.)</p>
<p>But, unfortunately, this doesn&rsquo;t solve what is actually the most horrible issue:
the mouse cursor sometimes, when in use, just teleports around the edges
of the screen and starts randomly clicking on things.</p>
<p>I finally turned up some discussion of this issue (though not for the
T440p specifically) at: <a href="https://bugzilla.kernel.org/show_bug.cgi?format=multiple&amp;id=209167">https://bugzilla.kernel.org/show_bug.cgi?format=multiple&amp;id=209167</a>
(The discussion suggests that it should somehow be solved in the
kernel, but that is not my experience, even running kernel 5.17.13.)</p>
<p>And found that adding <code>psmouse.proto=imps</code> to the kernel arguments and
disabling the touchpad in the stock BIOS solves the &ldquo;possessed mouse
cursor&rdquo; issue. For better or worse, it seem to make the TrackPoint be
detected as a generic PS/2 mouse. Which means that <code>drift_time</code> can no
longer be set, and I do get a little bit of drift from time to time,
but it&rsquo;s not too bad and certainly is far less maddening than the
&ldquo;possessed mouse cursor&rdquo; behaviour.</p>
<p>For Guix, the way to implement this is something along the lines of:</p>
<div class="highlight"><pre class="chroma"><code class="language-scheme" data-lang="scheme"><span class="p">(</span><span class="nf">operating-system</span>
 <span class="o">...</span>
 <span class="p">(</span><span class="nf">kernel-arguments</span> <span class="p">(</span><span class="nf">cons*</span> <span class="s">&#34;modprobe.blacklist=pcspkr,snd_pcsp&#34;</span> <span class="s">&#34;psmouse.proto=imps&#34;</span> <span class="s">&#34;acpi_osi=Linux&#34;</span> <span class="nv">%default-kernel-arguments</span><span class="p">))</span>
 <span class="o">...</span><span class="p">)</span>
</code></pre></div><p>(The other kernel arguments are simply the other ones I use, and are
not directly connected with this issue.)</p>
<p>Depending on the model of ThinkPad and/or the environment, using
<code>psmouse.proto=bare</code> instead may work better (see discussion at:
<a href="https://www.reddit.com/r/thinkpad/comments/v7vn0o/thinkpad_t440p_trackpoint_occasionally_going_crazy/icjkk0o/">https://www.reddit.com/r/thinkpad/comments/v7vn0o/thinkpad_t440p_trackpoint_occasionally_going_crazy/icjkk0o/</a>
).</p>
<p>So, perhaps not an entirely satisfactory solution, this impish
exorcism, but better than alternatives.</p>
]]></content>
            
                 
                    
                         
                        
                            
                             
                                <category scheme="https://babbagefiles.xyz/categories/thinkpad" term="thinkpad" label="thinkpad" />
                             
                                <category scheme="https://babbagefiles.xyz/categories/linux" term="linux" label="linux" />
                             
                                <category scheme="https://babbagefiles.xyz/categories/guix" term="guix" label="guix" />
                            
                        
                    
                 
                    
                 
                    
                
            
        </entry>
    
        
        <entry>
            <title type="html"><![CDATA[Guix, Nix: You are in a maze of twisty little $PATHs, some undefined]]></title>
            <link href="https://babbagefiles.xyz/guix-nix-maze-of-twisty-little-paths-undefined/"/>
            <id>https://babbagefiles.xyz/guix-nix-maze-of-twisty-little-paths-undefined/</id>
            
                    <author>
                        <name>Benjamin Slade</name>
                    </author>
            <published>2019-07-24T00:48:00-06:00</published>
            <updated>2019-07-24T16:58:13-06:00</updated>
            
            
            <content type="html"><![CDATA[<p>Some notes on interactive fiction/text adventure games and PATHs in
Guix, and StumpWM.</p>
<h2 id="maze-no-dot-1">Maze no. 1</h2>
<p>There may (likely is) some way of programmatically setting the X
Windows PATH variable in Guix System (née GuixSD) via the base
configuration (e.g. <code>config.scm</code>), but I haven&rsquo;t been able to uncover
anything that works. This is relevant for being able to use locally
installed static binaries or local shell scripts via the window
manager.</p>
<p>As a window-manager-specific workaround, in StumpWM, one can
programmatically set PATH variables via <code>(setf (getenv &quot;VARIABLE_NAME&quot;) &quot;variable-value&quot;)</code>. Thus, if you store local static
binaries and shell scripts in <code>~/bin</code>, the following (which you could
include in StumpWM&rsquo;s <code>init.lisp</code>) will add that to your PATH variable:</p>
<div class="highlight"><pre class="chroma"><code class="language-lisp" data-lang="lisp"><span class="p">(</span><span class="nb">setf</span> <span class="p">(</span><span class="nv">getenv</span> <span class="s">&#34;PATH&#34;</span><span class="p">)</span> <span class="p">(</span><span class="nv">concat</span> <span class="s">&#34;/home/YOURUSERNAME/bin:&#34;</span> <span class="p">(</span><span class="nv">getenv</span> <span class="s">&#34;PATH&#34;</span><span class="p">)))</span>
</code></pre></div><p>I use this with a static Haskell binary <a href="https://github.com/erebe/greenclip">greenclip</a>, which adds clipboard
functionality to <a href="https://github.com/davatorium/rofi/">rofi</a>, and with shell scripts that give &ldquo;pretty names&rdquo;
to Flatpak run commands.</p>
<p>For example, the literate/natural-language-based programming
interactive fiction design language <a href="http://inform7.com/">Inform7</a> (which is due to be
<a href="http://inform7.com/talks/2019/06/14/narrascope.html">open-sourced sometime this year</a>) is now conveniently <a href="https://flathub.org/apps/details/com.inform7.IDE">available as a
Flatpak</a>. But the run command after installing is <code>flatpak run com.inform7.IDE</code>, which is non-ideal. So I made a simple shell script
named <code>inform7</code> placed in <code>~/bin</code>:</p>
<div class="highlight"><pre class="chroma"><code class="language-shell" data-lang="shell"><span class="cp">#!/bin/sh
</span><span class="cp"></span>flatpak run com.inform7.IDE
</code></pre></div>


<figure>
    
        <img src="https://babbagefiles.xyz/ox-hugo/inform7-guix.png"/> </figure>

<h2 id="maze-no-dot-2">Maze no. 2</h2>
<p><a href="https://nixos.org/">Nix</a> can be <a href="https://nixos.org/releases/nix/nix-1.9/manual/#ch-installing-binary">installed as a standalone package manage on top of other
distros</a>, including Guix System, which is useful for be able to obtain
software currently lacking in Guix System (including, ironically,
<a href="https://en.wikipedia.org/wiki/Hugo_(software)">Hugo</a>, used by this blog, which is present in Nix). Packages available
in Nix but not in Guix include <a href="http://ccxvii.net/gargoyle/">Gargoyle</a>, a very nice interactive
fiction front-end client that supports a number of different backends,
including Frotz and Glulxe. One of the benefits of Gargoyle is that it
&ldquo;cares about typography&rdquo;. However, Nix applications by default seem to
have trouble finding/seeing fonts, including system fonts, local
fonts, and even fonts installed via Nix.</p>
<p>This can be fixed by (1) setting the <code>FONTCONFIG_PATH</code> and
<code>FONTCONFIG_FILE</code>, e.g. in StumpWM this can be done with:</p>
<div class="highlight"><pre class="chroma"><code class="language-lisp" data-lang="lisp"><span class="p">(</span><span class="nb">setf</span> <span class="p">(</span><span class="nv">getenv</span> <span class="s">&#34;FONTCONFIG_PATH&#34;</span><span class="p">)</span> <span class="s">&#34;/home/YOURUSERNAME/.config/fontconfig/&#34;</span><span class="p">)</span>
<span class="p">(</span><span class="nb">setf</span> <span class="p">(</span><span class="nv">getenv</span> <span class="s">&#34;FONTCONFIG_FILE&#34;</span><span class="p">)</span> <span class="s">&#34;fonts.conf&#34;</span><span class="p">)</span>
</code></pre></div><p>And (2) forcing Nix to look in the right places by manual
specification in <code>~/.config/fontconfig/fonts.conf</code>, adding right
before the final <code>&lt;/fontconfig&gt;</code> (as appropriate):</p>
<pre><code class="language-nil" data-lang="nil">&lt;cachedir prefix=&quot;xdg&quot;&gt;fontconfig&lt;/cachedir&gt;
&lt;dir&gt;/home/YOURUSERNAME/.local/share/fonts/&lt;/dir&gt;
&lt;dir&gt;/home/YOURUSERNAME/.nix-profile/share/fonts/&lt;/dir&gt;
&lt;dir&gt;/home/YOURUSERNAME/.guix-profile/share/fonts/&lt;/dir&gt;
&lt;dir&gt;/usr/share/fonts&lt;/dir&gt;
</code></pre><p>And regenerating the font cache (via <code>fc-cache -fv</code>) [possibly you may
need to install Nix&rsquo;s <code>fontconfig</code> package].</p>



<figure>
    
        <img src="https://babbagefiles.xyz/ox-hugo/counterfeit-gargoyle-screenshot.png"/> </figure>

]]></content>
            
                 
                    
                         
                        
                            
                             
                                <category scheme="https://babbagefiles.xyz/categories/lisp" term="lisp" label="lisp" />
                             
                                <category scheme="https://babbagefiles.xyz/categories/guix" term="guix" label="guix" />
                             
                                <category scheme="https://babbagefiles.xyz/categories/linux" term="linux" label="linux" />
                             
                                <category scheme="https://babbagefiles.xyz/categories/stumpwm" term="stumpwm" label="stumpwm" />
                             
                                <category scheme="https://babbagefiles.xyz/categories/intfic" term="intfic" label="intfic" />
                             
                                <category scheme="https://babbagefiles.xyz/categories/fonts" term="fonts" label="fonts" />
                             
                                <category scheme="https://babbagefiles.xyz/categories/inform" term="inform" label="inform" />
                            
                        
                    
                 
                    
                 
                    
                         
                        
                            
                             
                                <category scheme="https://babbagefiles.xyz/tags/nix" term="nix" label="nix" />
                             
                                <category scheme="https://babbagefiles.xyz/tags/gargoyle" term="gargoyle" label="gargoyle" />
                            
                        
                    
                
            
        </entry>
    
        
        <entry>
            <title type="html"><![CDATA[Confusion: PDP-10 Zork]]></title>
            <link href="https://babbagefiles.xyz/zork-confusion/"/>
            <id>https://babbagefiles.xyz/zork-confusion/</id>
            
                    <author>
                        <name>Benjamin Slade</name>
                    </author>
            <published>2018-09-23T23:52:00-05:00</published>
            <updated>2025-12-21T22:01:03-06:00</updated>
            
            
            <content type="html"><![CDATA[<p>I grew up playing <a href="https://en.wikipedia.org/wiki/Infocom">Infocom</a>, <a href="https://en.wikipedia.org/wiki/Magnetic_Scrolls">Magnetic Scrolls</a>, and <a href="https://en.wikipedia.org/wiki/Level_9_Computing">Level 9</a> text
adventures, with the <a href="https://en.wikipedia.org/wiki/Zork">Zork trilogy</a>, the <a href="https://en.wikipedia.org/wiki/Enchanter_(video_game)">Enchanter trilogy</a>, <a href="https://en.wikipedia.org/wiki/Planetfall">Planetfall</a>,
<a href="https://en.wikipedia.org/wiki/Wishbringer">Wishbringer</a>, <a href="https://en.wikipedia.org/wiki/The_Guild_of_Thieves">The Guild of Thieves</a>, <a href="https://en.wikipedia.org/wiki/The_Pawn">The Pawn</a>, <a href="https://en.wikipedia.org/wiki/Knight_Orc">Knight Orc</a>, and <a href="https://en.wikipedia.org/wiki/Silicon_Dreams">Silicon
Dreams</a> being particularly prominent in my memory (somewhat
re-activated through recent listening to the <a href="http://monsterfeet.com/grue/">Eaten by a Grue
podcast</a>). I would have played all of these on an Atari 8bit or ST
computer, and didn&rsquo;t have any access to anything like a mainframe, and
so never actually played the <a href="https://www.filfre.net/2012/01/zork-on-the-pdp-10/"><strong>original</strong> Zork</a>, which was written in the
<a href="https://en.wikipedia.org/wiki/MDL_(programming_language)">Lisp-derived MDL language</a> (which formed the basis for the MDL-subset
Infocom-specific <a href="https://en.wikipedia.org/wiki/Z-machine">ZIL language</a> used for their subsequent offerings) for
the <a href="https://en.wikipedia.org/wiki/PDP-10">DEC PDP-10</a>.</p>
<p>Fortunately, some years ago, Matthew Russotto created <a href="http://www.russotto.net/git/mrussotto/confusion/src/master/src/README">Confusion</a>, &ldquo;a
MDL interpreter which works just well enough to play the original Zork
all the way through&rdquo; and runs on Linux/Unix and presumably
macOS. I&rsquo;d tried to install this from Arch&rsquo;s AUR a couple of years
ago, without any luck. Inspecting the <a href="https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=mdli">package build</a>, the AUR Confusion
tries to get around errors by using an ancient version of gcc. I found
that a few fairly trivial fixes were enough to get it to compile with
a recent version of gcc, and so was finally able to try the original
Zork:</p>



<figure>
    
        <img src="https://babbagefiles.xyz/ox-hugo/mdl-zork-white-house.jpg"/> </figure>

<p>The most fun I always had in text adventures was exploring, and I&rsquo;ve
always found Infocom&rsquo;s various &ldquo;time-limit&rdquo; elements (batteries
running out, health deteriorating, &amp;c.) somewhat irritating. I
remembered that there&rsquo;s a torch in Zork I, and that is also true in
the original Zork, and I managed to obtain it early on so as to save
my (trusty brass) lamp&rsquo;s batteries. I then cheated somewhat wildly
(though, to be fair, a lot of the puzzles I had figured out once upon
a time in Zork I or Zork II; and the bank puzzle and some of the
others I wouldn&rsquo;t have patience for anymore).</p>
<p>The original code has some bugs in it which made things more
interesting.</p>
<pre><code class="language-ascii" data-lang="ascii">Narrow Ledge
You are on a narrow ledge overlooking the inside of an old dormant
volcano.  This ledge appears to be about in the middle between the
floor below and the rim above. There is an exit here to the south.
There is a very large and extremely heavy wicker basket with a cloth
bag here. Inside the basket is a metal receptacle of some kind.
Attached to the basket on the outside is a piece of wire.
The basket contains:
 A cloth bag
 A braided wire
 A receptacle
 The receptacle contains:
  A newspaper
 A blue label
There is a small hook attached to the rock here.

&gt; untie braided wire from hook

 *ERROR*
 &quot;FIRST-ARG-WRONG-TYPE&quot;
 &quot;First arg to NTH must be structured&quot;
LISTENING-AT-LEVEL 2 PROCESS 1
Atom REP has neither LVAL nor GVAL
</code></pre><p>I had a similar issue involving the result of a disagreement with a
suspicious-looking individual holding a bag. It turns out (thanks to
Matthew Russotto for the following information) that this has to do
with issues in saving and restoring files, and (failure of) either
properly recording or decoding certain values. The balloon issue has
to do with a record about the object burning in the receptacle. It is
saved as <code>BINF!-FLAG</code>, which should be a boolean-type flag, but at
some point it became an object (recording what is burning) and
apparently isn&rsquo;t decoded properly on a restore. Saving-and-restoring
during a battle with the suspicious-looking individual produces a
similar error to the balloon-burnable error, due to the
<code>THIEF-ENGROSSED!-FLAG</code> (which apparently really is a flag) not
being saved properly. The upshot (for a player) is that you shouldn&rsquo;t
save during either of these bits of the game.</p>
<p>With these additional lurking grues out of the way, I was able to make
it to the end of the game:</p>



<figure>
    
        <img src="https://babbagefiles.xyz/ox-hugo/zork-end.png"/> </figure>

<p>Speaking of saving, MDL Zork only has a single restore file. It is
stored in the <code>MTRZORK</code> directory and is named <code>ZORK.SAVE</code>. Of course
you can create additional saves by copying out this save file to
different names.</p>
<p>If you too want to play the original Zork using the original PDP-10 MDL
source code, you should be able to build the MDL interpreter necessary
from the release at Matthew Russotto&rsquo;s site (where my minor patches
should be incorporated):
<a href="http://www.russotto.net/git/mrussotto/confusion/releases">http://www.russotto.net/git/mrussotto/confusion/releases</a> or
from the git repo with my patches at
<a href="https://github.com/emacsomancer/confusion-mdl">https://github.com/emacsomancer/confusion-mdl</a>.</p>
<p>Or, the easiest of all, install it via Guix (<a href="https://www.gnu.org/software/guix/manual/en/html_node/Binary-Installation.html#Binary-Installation">which can installed on
top of your current distro as a standalone package manager</a>), as I have
created a Guix package which was accepted upstream (the package name
in Guix is <code>confusion-mdl</code>). [note: this Guix package stopped building
some time ago and I need to figure out what needs fixing. Right now,
have a look at the mdlzork project at
<a href="https://github.com/jordanhubbard/mdlzork">https://github.com/jordanhubbard/mdlzork</a> , which provides a way to
easily play early versions of Zork online at
<a href="https://jordanhubbard.github.io/mdlzork/">https://jordanhubbard.github.io/mdlzork/</a>.]</p>
<p>Since I played through this right before designing the propositional
logic homework for my Semantics class, my students are currently
&ldquo;enjoying&rdquo; doing Zork-flavoured propositional logic translations,
e.g.:</p>
<ol>
<li>The thief only steals your things when you&rsquo;re in the cellar.</li>
<li>Your sword glows blue whenever the thief or the troll is near and
never any other time.</li>
<li>Whether or not you are lost in a maze of twisty little passages
(all alike), the grues are lurking in the darkness.</li>
<li>The grues will eat you unless you bring a light source.</li>
</ol>
]]></content>
            
                 
                    
                         
                        
                            
                             
                                <category scheme="https://babbagefiles.xyz/categories/lisp" term="lisp" label="lisp" />
                             
                                <category scheme="https://babbagefiles.xyz/categories/mdl" term="mdl" label="mdl" />
                             
                                <category scheme="https://babbagefiles.xyz/categories/intfict" term="intfict" label="intfict" />
                             
                                <category scheme="https://babbagefiles.xyz/categories/guix" term="guix" label="guix" />
                            
                        
                    
                 
                    
                 
                    
                         
                        
                            
                             
                                <category scheme="https://babbagefiles.xyz/tags/zork" term="zork" label="zork" />
                            
                        
                    
                
            
        </entry>
    
        
        <entry>
            <title type="html"><![CDATA[Dockerised Firefox on GuixSD]]></title>
            <link href="https://babbagefiles.xyz/dockerised_firefox_guix/"/>
            <id>https://babbagefiles.xyz/dockerised_firefox_guix/</id>
            
                    <author>
                        <name>Benjamin Slade</name>
                    </author>
            <published>2018-09-15T20:18:00-06:00</published>
            <updated>2018-09-15T20:29:22-06:00</updated>
            
            
            <content type="html"><![CDATA[<p>So GuixSD doesn&rsquo;t currently package Firefox (<a href="https://lists.gnu.org/archive/html/guix-devel/2018-05/msg00021.html">though hopefully that
is changing</a>), but only IceCat (which is now EOL). On freenode#guix,
pkill9 suggested that Firefox (and Chromium etc.) could be installed
on Guix via the <a href="https://nixos.org/nix/download.html">Nix</a> installer (install as per instructions on their
site and then <code>nix-env -i firefox</code>) with the following trick, create a
file <code>~/.local/bin/firefox</code> with the following content:</p>
<div class="highlight"><pre class="chroma"><code class="language-shell" data-lang="shell"><span class="c1"># Wrapper to run the Firefox built and packaged by Nix</span>
<span class="nv">MESA_LIB</span><span class="o">=</span><span class="k">$(</span>dirname <span class="k">$(</span>realpath /run/current-system/profile/lib/libGL.so<span class="k">))</span> <span class="c1">#To get webgl working</span>
<span class="nb">export</span> <span class="nv">LD_LIBRARY_PATH</span><span class="o">=</span><span class="s2">&#34;</span><span class="nv">$MESA_LIB</span><span class="si">${</span><span class="nv">LD_LIBRARY_PATH</span><span class="p">:+:</span><span class="si">}</span><span class="nv">$LD_LIBRARY_PATH</span><span class="s2">&#34;</span>
<span class="c1">#export FONTCONFIG_PATH=&#34;$(guix build fontconfig)/etc/fonts${FONTCONFIG_PATH:+:}$FONTCONFIG_PATH&#34;</span>
<span class="nb">export</span> <span class="nv">FONTCONFIG_PATH</span><span class="o">=</span><span class="s2">&#34;</span><span class="k">$(</span>guix build fontconfig<span class="k">)</span><span class="s2">/etc/fonts&#34;</span>
<span class="nb">exec</span> -a <span class="s2">&#34;</span><span class="nv">$0</span><span class="s2">&#34;</span> <span class="s2">&#34;/nix/var/nix/profiles/per-user/</span><span class="nv">$USER</span><span class="s2">/profile/bin/firefox&#34;</span> <span class="s2">&#34;</span><span class="nv">$@</span><span class="s2">&#34;</span>
</code></pre></div><p>And then add <code>~/.local/bin</code> to your <code>$PATH</code> in <code>~/.profile</code>.</p>
<p>Unfortunately I haven&rsquo;t been able to get that to work, though I could
be doing something daft.</p>
<p>I figured out the following (elaborate) alternative workaround for
Firefox (no luck for Chromium):</p>
<ul>
<li>
<ol>
<li>Install Docker via Nix. Launch with <code>sudo dockerd</code>.</li>
</ol>
</li>
<li>
<ol start="2">
<li>Create a Dockerfile for Firefox</li>
</ol>
</li>
</ul>
<div class="highlight"><pre class="chroma"><code class="language-Dockerfile" data-lang="Dockerfile"><span class="c"># firefox in a docker container</span><span class="err">
</span><span class="err"></span><span class="c"># the following line will start firefox in the container, thus</span><span class="err">
</span><span class="err"></span><span class="c"># video and sound will be played on the host machine</span><span class="err">
</span><span class="err"></span><span class="k">FROM</span><span class="s"> alpine:edge</span><span class="err">
</span><span class="err"></span><span class="k">MAINTAINER</span><span class="s"> slade@jnanam.net</span><span class="err">
</span><span class="err">
</span><span class="err"></span><span class="c"># add testing repo + install packages + add user and group</span><span class="err">
</span><span class="err"></span><span class="k">RUN</span> <span class="nb">echo</span> <span class="s2">&#34;http://dl-cdn.alpinelinux.org/alpine/edge/testing/&#34;</span> &gt;&gt; /etc/apk/repositories <span class="se">\
</span><span class="se"></span>    <span class="o">&amp;&amp;</span> apk add --no-cache <span class="se">\
</span><span class="se"></span>       xz <span class="se">\
</span><span class="se"></span>       dbus-x11 <span class="se">\
</span><span class="se"></span>       ttf-dejavu <span class="se">\ </span>         <span class="c1"># a bunch of fonts; you may not want all of these</span><span class="err">
</span><span class="err"></span>       ttf-freefont <span class="se">\
</span><span class="se"></span>       ttf-ubuntu-font-family <span class="se">\
</span><span class="se"></span>       font-noto <span class="se">\
</span><span class="se"></span>       font-noto-extra <span class="se">\
</span><span class="se"></span>       font-noto-emoji <span class="se">\
</span><span class="se"></span>       font-noto-oriya <span class="se">\
</span><span class="se"></span>       font-noto-tamil <span class="se">\
</span><span class="se"></span>       font-noto-avestan <span class="se">\
</span><span class="se"></span>       font-noto-gothic <span class="se">\
</span><span class="se"></span>       font-noto-myanmar <span class="se">\
</span><span class="se"></span>       font-noto-telugu <span class="se">\
</span><span class="se"></span>       font-noto-deseret <span class="se">\
</span><span class="se"></span>       font-noto-bengali <span class="se">\
</span><span class="se"></span>       font-noto-kannada <span class="se">\
</span><span class="se"></span>       font-noto-ethiopic <span class="se">\
</span><span class="se"></span>       font-noto-armenian <span class="se">\
</span><span class="se"></span>       font-noto-tibetan <span class="se">\
</span><span class="se"></span>       font-noto-sinhala <span class="se">\
</span><span class="se"></span>       font-noto-gurmukhi <span class="se">\
</span><span class="se"></span>       font-noto-malayalam <span class="se">\
</span><span class="se"></span>       font-noto-gujarati <span class="se">\
</span><span class="se"></span>       font-noto-devanagari <span class="se">\
</span><span class="se"></span>       font-noto-thai <span class="se">\
</span><span class="se"></span>       font-noto-adlam <span class="se">\
</span><span class="se"></span>       font-noto-nko <span class="se">\
</span><span class="se"></span>       font-noto-lisu <span class="se">\
</span><span class="se"></span>       font-noto-carian <span class="se">\
</span><span class="se"></span>       font-noto-buhid <span class="se">\
</span><span class="se"></span>       font-noto-osage <span class="se">\
</span><span class="se"></span>       font-noto-hebrew <span class="se">\
</span><span class="se"></span>       font-noto-arabic <span class="se">\
</span><span class="se"></span>       font-noto-chakma <span class="se">\
</span><span class="se"></span>       font-noto-gothic <span class="se">\
</span><span class="se"></span>       font-noto-khmer <span class="se">\
</span><span class="se"></span>       font-noto-cypriot <span class="se">\
</span><span class="se"></span>       font-noto-kayahli <span class="se">\
</span><span class="se"></span>       font-noto-mandaic <span class="se">\
</span><span class="se"></span>       font-noto-olchiki <span class="se">\
</span><span class="se"></span>       font-noto-thaana <span class="se">\
</span><span class="se"></span>       font-noto-georgian <span class="se">\
</span><span class="se"></span>       font-noto-shavian <span class="se">\
</span><span class="se"></span>       font-noto-cherokee <span class="se">\
</span><span class="se"></span>       font-noto-oldturkic <span class="se">\
</span><span class="se"></span>       font-noto-osmanya <span class="se">\
</span><span class="se"></span>       font-noto-glagolitic <span class="se">\
</span><span class="se"></span>       font-noto-tifinagh <span class="se">\
</span><span class="se"></span>       font-noto-adlamunjoined <span class="se">\
</span><span class="se"></span>       font-noto-nko <span class="se">\
</span><span class="se"></span>       font-noto-lao <span class="se">\
</span><span class="se"></span>       arc-theme <span class="se">\
</span><span class="se"></span>       hunspell <span class="se">\
</span><span class="se"></span>       hunspell-en <span class="se">\
</span><span class="se"></span>       firefox <span class="se">\
</span><span class="se"></span>       libcanberra-gtk2 <span class="se">\
</span><span class="se"></span>       pulseaudio <span class="se">\
</span><span class="se"></span>    <span class="o">&amp;&amp;</span> rm -fr /var/cache/apk/* <span class="se">\
</span><span class="se"></span>    <span class="o">&amp;&amp;</span> adduser -D -u <span class="m">1000</span> -g <span class="m">1000</span> user<span class="err">
</span><span class="err">
</span><span class="err"></span><span class="c"># add user&#39;s work</span><span class="err">
</span><span class="err"></span><span class="k">WORKDIR</span><span class="s"> /home/user</span><span class="err">
</span><span class="err">
</span><span class="err"></span><span class="c"># switch to user</span><span class="err">
</span><span class="err"></span><span class="k">USER</span><span class="s"> user</span><span class="err">
</span><span class="err">
</span><span class="err"></span><span class="k">ENTRYPOINT</span> <span class="p">[</span><span class="s2">&#34;/usr/bin/firefox&#34;</span><span class="p">,</span> <span class="s2">&#34;--no-remote&#34;</span><span class="p">]</span><span class="err">
</span></code></pre></div><p>Save the above out to a file <code>Dockerfile</code> in some directory. <code>cd</code> to
that directory. Then create a Docker container with <code>docker build -t someprefix/firefox .</code> (with <code>someprefix</code> being whatever you like).</p>
<ul>
<li>
<ol start="3">
<li>Create in <code>~/.local/bin/firefox</code>:</li>
</ol>
</li>
</ul>
<div class="highlight"><pre class="chroma"><code class="language-shell" data-lang="shell"><span class="cp">#!/bin/sh
</span><span class="cp"></span><span class="c1"># Wrapper to run the Chromium built and packaged by Nix</span>
xhost +local:docker@<span class="p">;</span> <span class="se">\
</span><span class="se"></span>docker run --rm -it -e <span class="nv">DISPLAY</span><span class="o">=</span><span class="nv">$DISPLAY</span> -v /tmp/.X11-unix/:/tmp/.X11-unix <span class="se">\
</span><span class="se"></span>-v /dev/snd:/dev/snd <span class="se">\
</span><span class="se"></span>-v /run/user/<span class="nv">$USER_UID</span>/pulse:/run/pulse:ro <span class="se">\
</span><span class="se"></span>-v /home/<span class="nv">$USER</span>/.mozilla:/home/user/.mozilla <span class="se">\
</span><span class="se"></span>-v /home/<span class="nv">$USER</span>/.cache/mozilla:/home/user/.cache/mozilla <span class="se">\
</span><span class="se"></span>-v /tmp/Downloads:/tmp/Downloads <span class="se">\
</span><span class="se"></span>-v /home/<span class="nv">$USER</span>/.gtkrc-2.0:/home/user/.gtkrc-2.0 <span class="se">\
</span><span class="se"></span>-v /home/<span class="nv">$USER</span>/.config/gtk-3.0/:/home/user/.config/gtk-3.0 <span class="se">\
</span><span class="se"></span>-v /home/<span class="nv">$USER</span>/.nix-profile/share/fonts/truetype:/usr/share/fonts/truetype-nix <span class="se">\ </span><span class="c1"># for nix fonts, if you have them here</span>
-v /home/<span class="nv">$USER</span>/.nix-profile/share/fonts/ubuntu:/usr/share/fonts/ubuntu-nix <span class="se">\ </span>    <span class="c1"># ditto</span>
-v /home/<span class="nv">$USER</span>/.nix-profile/share/fonts/noto:/usr/share/fonts/noto-nix <span class="se">\ </span>        <span class="c1"># ditto</span>
-v /home/<span class="nv">$USER</span>/.guix-profile/share/fonts/truetype:/user/share/fonts/truetype-guix <span class="se">\ </span><span class="c1"># for guix fonts, if you have them here</span>
-v /home/<span class="nv">$USER</span>/.guix-profile/share/fonts/opentype:/usr/share/fonts/opentype-guix <span class="se">\ </span><span class="c1"># ditto</span>
 --shm-size 2g  --privileged someprefix/firefox  <span class="c1"># substitute your prefix here for &#34;someprefix&#34;</span>
</code></pre></div><p>Where again <code>someprefix</code> is whatever you chose before. <code>chmod +x ~/.local/bin/firefox</code> and then you can run Firefox with
<code>firefox</code>. (You&rsquo;ll have to make sure <code>dockerd</code> is running.)</p>
<p>Perhaps this could be useful elsewhere. It has the advantage of being
a nice <a href="https://alpinelinux.org/">Alpine Linux</a> <a href="https://www.musl-libc.org/">musl-libc</a>/<a href="https://www.libressl.org/">libressl</a> build of Firefox running inside
your GuixSD (or whatever you&rsquo;re using).</p>
<p>What doesn&rsquo;t work:</p>
<ul>
<li>Spellchecking - I don&rsquo;t quite know why, hunspell should be
available. Just disable spellchecking for now (otherwise everything
will be underlined in red).</li>
<li><a href="https://wire.com">Wire</a>&lsquo;s web portal.</li>
<li>Saving or uploading from anywhere but <code>/tmp/Downloads</code> (but this is
a feature really).</li>
<li>If you want CJK fonts, you&rsquo;ll have to install them in Nix or Guix
(Alpine doesn&rsquo;t seem to have any); this is indicated in the Firefox
launch script above.</li>
</ul>
]]></content>
            
                 
                    
                         
                        
                            
                             
                                <category scheme="https://babbagefiles.xyz/categories/lisp" term="lisp" label="lisp" />
                             
                                <category scheme="https://babbagefiles.xyz/categories/guix" term="guix" label="guix" />
                             
                                <category scheme="https://babbagefiles.xyz/categories/docker" term="docker" label="docker" />
                             
                                <category scheme="https://babbagefiles.xyz/categories/firefox" term="firefox" label="firefox" />
                            
                        
                    
                 
                    
                 
                    
                
            
        </entry>
    
        
        <entry>
            <title type="html"><![CDATA[Guix: You are in a maze of lispy little passages, (map equal? ′(′all ′alike) ′(′all ′alike))]]></title>
            <link href="https://babbagefiles.xyz/guix_maze_of_lispy_little_passages/"/>
            <id>https://babbagefiles.xyz/guix_maze_of_lispy_little_passages/</id>
            
                    <author>
                        <name>Benjamin Slade</name>
                    </author>
            <published>2018-08-04T21:47:00-05:00</published>
            <updated>2025-02-24T04:41:50-06:00</updated>
            
            
            <content type="html"><![CDATA[<p>So I finally made a serious go of running <a href="https://www.gnu.org/software/guix/">GuixSD</a>, a GNU Linux distro
which is largely built on <a href="https://en.wikipedia.org/wiki/GNU_Guile">GNU Guile Scheme</a> (a dialect of Lisp) on one
of my machines (one I had actually put together with GuixSD in mind:
an X200 Thinkpad, which I <a href="https://libreboot.org/">Libreboot</a>&lsquo;ed and put a Atheros Wi-Fi card
in), and, to increase both the quantity and variety of Lisps involved,
am trying to use with <a href="https://stumpwm.github.io/">StumpWM</a> (which is written in Common Lisp).</p>
<p>It&rsquo;s a fascinating distro, modelled on <a href="https://nixos.org/">Nix</a>, but implemented in
Guile. It&rsquo;s not been exactly easy to get running (<a href="https://www.gnu.org/software/guix/blog/2017/back-from-fosdem-2017/">one of the videos on
GuixSD from Fosdem 2017</a> included the line &ldquo;[GuixSD] is like Gentoo for
grown ups&rdquo;), in part because its architecture is rather different from what
I&rsquo;ve experienced with other Linux distros, which use different package
managers perhaps and sometimes even different libc&rsquo;s, but generally
follow a similar design philosophy. Rather than spreading out
configuration across lots of different pieces, GuixSD seems to largely
try to concentrate it in specific configuration files which are
transactional in that they can be rolled back (and thus the system can
be rolled back to known working states).</p>
<p>It is a GNU-blessed distro, and does take the FSF&rsquo;s hard line (and to
my eyes sometimes weird line) approach to software. So no proprietary
software is included in the Guix repos, including firmware (and it
runs on the linux-libre kernel). That by itself is fine, but it means
the state of affairs for Guix-packaged browsers is pretty poor. No
Chromium, no Firefox. IceCat 52 is essentially what&rsquo;s currently
available (if IceCat were up to the latest Firefox ESR 60, it might be
easier) in terms of browsers which might be considered secure.</p>
<p>This led me to try to use the Nix installer by itself<sup><a href="#org-target--0b">*</a></sup><span class="org-target" id="org-target--0t"></span> to try to
install Firefox and Chromium. Sadly, I can&rsquo;t get Nix&rsquo;s Chromium to
work at all on GuixSD, and while Firefox works fine, I can&rsquo;t get it to
see my locally installed fonts (or other fonts I&rsquo;ve installed via
Nix).</p>
<p>Hopefully at some point <a href="http://next-browser.com/">Next Browser</a> will be packaged for Guix, to
bring in another major component written in (Common) Lisp. And when
(if?) IceCat 60 comes out, that will alleviate the pain somewhat. (I
was a long-time <a href="http://conkeror.org/">Conkeror</a> user, and I briefly tried it again in GuixSD,
but I&rsquo;m not certain of its security and uBlock Origin no long works
with it, which I believe is why I stopped using it in the first
place).</p>
<p>Other interesting Lispy pieces include <a href="https://www.gnu.org/software/mcron/">mcron</a>, a cron which accepts (as
well as Vixie cron style, I think) Guile config files. The <a href="https://www.gnu.org/software/guix/manual/en/html_node/Scheduled-Job-Execution.html">examples in
Guix manual</a> I couldn&rsquo;t really get to work. But via the <code>help-guix</code>
listserv I found that one can put simple guile scripts in
<code>~/.config/cron/job.guile</code>. Working out how to do a &lsquo;run this every N
minutes&rsquo; was not immediately obvious, but I figured out how to do it,
e.g.:</p>
<pre><code class="language-guile" data-lang="guile">; execute run_me every 5 minutes
(job '(next-minute (range 0 60 5)) &quot;run_me&quot;)
; run execute_me every 2 hours
(job '(next-hour (range 0 24 2)) &quot;execute_me&quot;)
</code></pre><p>One of the other great things about GuixSD is that its init manager,
<a href="https://www.gnu.org/software/shepherd/">GNU Shepherd</a>, is also written in Guile Scheme. I&rsquo;ve only had a chance
to play with it a little bit, but it seems very nice and it&rsquo;s good to
find other innovative init managers (I would mention here also <a href="http://smarden.org/runit/">runit</a>
and <a href="https://skarnet.org/software/s6/">s6</a>) which take very different approaches to <a href="https://www.freedesktop.org/wiki/Software/systemd/">systemd</a> (another
innovative init, or perhaps init+, but one that creates more problems
than it solves in the end, in my experience).</p>
<p>On the Guix package manager itself: I learned the hard way that
searching for packages in Guix is really only comfortable within
Emacs: so do <code>guix package -i guix-emacs</code> and then do everything else
from guix-emacs within Emacs ( <code>M-x guix-search-by-name</code> to search
package names by regex; and <code>M-x guix-search-by-regex</code> to search
names+descriptions by regex). The results returned by <code>guix package -s ....</code> in a terminal are not very browseable (though I tried valiantly
for some time). But if you&rsquo;re interested in Guix, you&rsquo;ll likely
interested in Emacs anyway.</p>
<p>What I&rsquo;m trying to build on this machine is something with lots of
Lisp. Of course the kernel is still a kernel written in C, as are lots
of the other pieces like the terminal &amp;c., but much of the user-facing
things: the package manager, the windows manager, the init, the job
scheduler (=cron), and (most importantly perhaps) the &lsquo;text editor&rsquo;
(read: document composer, email interface, irc interface, twitter
interface, blog post interface, code editor &hellip;) are all largely
written in and interacted with using some form of Lisp (Guile Scheme,
Common Lisp, Emacs Lisp).</p>
<p>Guix is a bit like Emacs, I think. It&rsquo;s an incredibly powerful tool
with lots of interesting possibilities, but when you start using it
you&rsquo;re presented with an empty screen with little indication of what
you can do. I&rsquo;ll be sticking with it, I think. Now I&rsquo;ve got to get to
grips with StumpWM and figure out how to configure <a href="https://github.com/jaagr/polybar">polybar</a>&hellip;</p>
<p>[And if you&rsquo;re curious about why Guix is pronounced like &ldquo;geeks&rdquo;, have
a look at <a href="https://slade.jnanam.net/post/scheming-french-geeks-with-guile/">this post over on my linguistics blog</a>.]</p>
<p><a href="#org-target--0t">*</a><span class="org-target" id="org-target--0b"></span> As well as being the package managers of both of their
respective distros, both the Nix and Guix package managers can be used
<strong>on top of</strong> other distros. Nix doesn&rsquo;t have quite the same hard line
approach to software licences as Guix.</p>
]]></content>
            
                 
                    
                         
                        
                            
                             
                                <category scheme="https://babbagefiles.xyz/categories/lisp" term="lisp" label="lisp" />
                             
                                <category scheme="https://babbagefiles.xyz/categories/guix" term="guix" label="guix" />
                             
                                <category scheme="https://babbagefiles.xyz/categories/linux" term="linux" label="linux" />
                             
                                <category scheme="https://babbagefiles.xyz/categories/stumpwm" term="stumpwm" label="stumpwm" />
                             
                                <category scheme="https://babbagefiles.xyz/categories/emacs" term="emacs" label="emacs" />
                            
                        
                    
                 
                    
                 
                    
                
            
        </entry>
    
</feed>
