<?xml version="1.0" encoding="utf-8"?><feed xmlns="http://www.w3.org/2005/Atom"><title>grop.dev</title><id>https://grop.dev/feeds/tags/guix.xml</id><subtitle>Tag: guix</subtitle><updated>2026-10-03T11:42:51Z</updated><link href="https://grop.dev/feeds/tags/guix.xml" rel="self" /><link href="https://grop.dev" /><entry><title>Trusting CA certificates in Guix System</title><id>https://grop.dev/posts/trusting-ca-certificates-in-guix-system.html</id><author><name>Gunnar Grop</name><email>gunnar.grop@protonmail.com</email></author><updated>2026-08-15T11:43:00Z</updated><link href="https://grop.dev/posts/trusting-ca-certificates-in-guix-system.html" rel="alternate" /><content type="html">&lt;p&gt;I'm going to be honest. It took me frankly an embarassing amount of time to
figure out how I could trust custom CA certificates in Guix System. I've been using
it as my main operating system for almost a year at this point, and I only figured
this out recently.&lt;/p&gt;&lt;p&gt;The core of my problem was (apart from not being very good at Scheme or Guix) that
this wasn't clearly documented anywhere. Mainstream GNU/Linux distros have a clear
way to do this. Just place the PEM encoded files under &lt;code&gt;/usr/local/share/ca-certificates&lt;/code&gt;
or &lt;code&gt;/etc/pki/trust/anchors&lt;/code&gt;, or something similar, then run &lt;code&gt;update-ca-certificates&lt;/code&gt;.
The certificates will then be added to the system wide trust bundle, usually somewhere
under &lt;code&gt;/etc/ssl/certs&lt;/code&gt;.
Even Nix, which Guix is originally forked from, has a &lt;a href=&quot;https://wiki.nixos.org/wiki/SSL_Certificates&quot;&gt;short and very clear article&lt;/a&gt; about
how to do this.&lt;/p&gt;&lt;p&gt;Guix just has this article: &lt;a href=&quot;https://guix.gnu.org/manual/1.5.0/en/html_node/X_002e509-Certificates.html&quot;&gt;X.509 Certificates&lt;/a&gt;. Nowhere does it say how do actually ensure
certificates end up in the systems trust bundle. It does mention the &lt;a href=&quot;https://codeberg.org/guix/guix/src/commit/f250e74dd4a4ba2e7f4a62369bf04c1b06756f9c/gnu/packages/nss.scm#L318&quot;&gt;nss-certs&lt;/a&gt; package, which
Guix installs by default to provide CA certs from Mozilla.&lt;/p&gt;&lt;p&gt;Being quite new to Scheme and Guix, I got way to hung up on this package.
For some reason I was under the impressions that this package took care of actually generating
the trust bundle at &lt;code&gt;/etc/ssl/certs/ca-certificates.crt&lt;/code&gt;, which is does not.
Turns out, I didn't need to care about &lt;a href=&quot;https://codeberg.org/guix/guix/src/commit/f250e74dd4a4ba2e7f4a62369bf04c1b06756f9c/gnu/packages/nss.scm#L318&quot;&gt;nss-certs&lt;/a&gt; at all.&lt;/p&gt;&lt;p&gt;If we look at that file, it should be obvious.&lt;/p&gt;&lt;pre&gt;&lt;code&gt;$ ls -la /etc/ssl/certs/ca-certificates.crt
lrwxrwxrwx 1 root root 99  1 jan  1970 /etc/ssl/certs/ca-certificates.crt -&amp;gt; /gnu/store/l3y2wisv02pq1qkh6j101crr8bjs0xzr-ca-certificate-bundle/etc/ssl/certs/ca-certificates.crt&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;It's not even part of the nss-certs &lt;code&gt;/gnu/store/&lt;/code&gt; item!&lt;/p&gt;&lt;p&gt;Then I found another package, &lt;a href=&quot;https://codeberg.org/guix/guix/src/commit/f250e74dd4a4ba2e7f4a62369bf04c1b06756f9c/gnu/packages/certs.scm#L129&quot;&gt;le-certs&lt;/a&gt;, a package for installing root and intermediate CA
certs from Let's Encrypt, and at this point it became quite clear that I'd been an idiot.
Turns out, you can just write a package that ensures some certificates files gets placed
under &lt;code&gt;/etc/ssl/certs&lt;/code&gt; and create the appropriate hash symlinks with &lt;code&gt;c_rehash&lt;/code&gt;, then Guix
will make sure those certs end up in the system trust bundle.&lt;/p&gt;&lt;p&gt;You can create a package definition anywhere, maybe just in your dotfiles repository, but
I opted to create an actual &lt;a href=&quot;https://guix.gnu.org/manual/1.5.0/en/html_node/Channels.html&quot;&gt;channel&lt;/a&gt; since I wanted this package to me installed on both my
PC's, and on my virtual machines (managed via a different central repository).&lt;/p&gt;&lt;p&gt;For reference, here is my Guix channel: &lt;a href=&quot;https://git.sr.ht/~gunnargrop/guix-channel&quot;&gt;https://git.sr.ht/~gunnargrop/guix-channel&lt;/a&gt;.
And here is the &lt;code&gt;tree&lt;/code&gt; output:&lt;/p&gt;&lt;pre&gt;&lt;code&gt;.
├── COPYING
├── gunnargrop
│   ├── auxillary
│   │   └── ca-certs
│   │       ├── gunnar-grop-ca.pem
│   │       └── home-internal-ca.pem
│   ├── packages
│   │   └── pki.scm
│   └── services
│       └── virtualization.scm
└── README.md&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Here is what &lt;code&gt;(gunnargrop packages pki)&lt;/code&gt; looks like:&lt;/p&gt;&lt;pre&gt;&lt;code&gt;&lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-special&quot;&gt;define-module&lt;/span&gt; &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;gunnargrop&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;packages&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;pki&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
  &lt;span class=&quot;syntax-keyword&quot;&gt;#:use-module&lt;/span&gt; &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;guix&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;licenses&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;syntax-keyword&quot;&gt;#:prefix&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;license:&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
  &lt;span class=&quot;syntax-keyword&quot;&gt;#:use-module&lt;/span&gt; &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;guix&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;build-system&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;trivial&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
  &lt;span class=&quot;syntax-keyword&quot;&gt;#:use-module&lt;/span&gt; &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;guix&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;packages&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
  &lt;span class=&quot;syntax-keyword&quot;&gt;#:use-module&lt;/span&gt; &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;guix&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;gexp&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
  &lt;span class=&quot;syntax-keyword&quot;&gt;#:use-module&lt;/span&gt; &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;guix&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;utils&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
  &lt;span class=&quot;syntax-keyword&quot;&gt;#:use-module&lt;/span&gt; &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;gnu&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;packages&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;tls&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
  &lt;span class=&quot;syntax-keyword&quot;&gt;#:use-module&lt;/span&gt; &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;gnu&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;packages&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;perl&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;

&lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-special&quot;&gt;define-public&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;grop-certs&lt;/span&gt;
  &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;package&lt;/span&gt;
   &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;name&lt;/span&gt; &lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;grop-certs&amp;quot;&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
   &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;version&lt;/span&gt; &lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;1&amp;quot;&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
   &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;source&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;#f&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
   &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;build-system&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;trivial-build-system&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
   &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;inputs&lt;/span&gt;
    &lt;span class=&quot;syntax-symbol&quot;&gt;`&lt;/span&gt;&lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;gunnar-grop-root&amp;quot;&lt;/span&gt;
       &lt;span class=&quot;syntax-symbol&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;local-file&lt;/span&gt; &lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;../auxillary/ca-certs/gunnar-grop-ca.pem&amp;quot;&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
      &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;home-internal-root&amp;quot;&lt;/span&gt;
       &lt;span class=&quot;syntax-symbol&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;local-file&lt;/span&gt; &lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;../auxillary/ca-certs/home-internal-ca.pem&amp;quot;&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
   &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;native-inputs&lt;/span&gt;
    &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;list&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;openssl&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;perl&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
   &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;arguments&lt;/span&gt;
    &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;list&lt;/span&gt;
     &lt;span class=&quot;syntax-keyword&quot;&gt;#:modules&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;'&lt;/span&gt;&lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;guix&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;build&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;utils&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
     &lt;span class=&quot;syntax-keyword&quot;&gt;#:builder&lt;/span&gt;
     &lt;span class=&quot;syntax-symbol&quot;&gt;#~&lt;/span&gt;&lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-special&quot;&gt;begin&lt;/span&gt;
         &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;use-modules&lt;/span&gt; &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;guix&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;build&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;utils&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;

         &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-special&quot;&gt;let&lt;/span&gt; &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;out&lt;/span&gt; &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;string-append&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;#$output&lt;/span&gt; &lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;/etc/ssl/certs&amp;quot;&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
               &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;openssl&lt;/span&gt;
                &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;assoc-ref&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;%build-inputs&lt;/span&gt; &lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;openssl&amp;quot;&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
               &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;perl&lt;/span&gt;
                &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;assoc-ref&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;%build-inputs&lt;/span&gt; &lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;perl&amp;quot;&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
               &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;gunnar-grop-root&lt;/span&gt; &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;assoc-ref&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;%build-inputs&lt;/span&gt; &lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;gunnar-grop-root&amp;quot;&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
               &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;home-internal-root&lt;/span&gt; &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;assoc-ref&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;%build-inputs&lt;/span&gt; &lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;home-internal-root&amp;quot;&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;

           &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;mkdir-p&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;out&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
           &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-special&quot;&gt;for-each&lt;/span&gt;
            &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-special&quot;&gt;lambda&lt;/span&gt; &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;cert&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
              &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;copy-file&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;cert&lt;/span&gt; &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;string-append&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;out&lt;/span&gt; &lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;/&amp;quot;&lt;/span&gt;
                                             &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;strip-store-file-name&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;cert&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
            &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;list&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;gunnar-grop-root&lt;/span&gt;
                  &lt;span class=&quot;syntax-symbol&quot;&gt;home-internal-root&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;

           &lt;span class=&quot;syntax-comment&quot;&gt;;; Create hash symlinks suitable for OpenSSL ('SSL_CERT_DIR' and
&lt;/span&gt;           &lt;span class=&quot;syntax-comment&quot;&gt;;; similar.)
&lt;/span&gt;           &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;chdir&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;out&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
           &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;invoke&lt;/span&gt; &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;string-append&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;perl&lt;/span&gt; &lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;/bin/perl&amp;quot;&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
                   &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;string-append&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;openssl&lt;/span&gt; &lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;/bin/c_rehash&amp;quot;&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
                   &lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;.&amp;quot;&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;

   &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;home-page&lt;/span&gt; &lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;https://grop.dev&amp;quot;&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
   &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;synopsis&lt;/span&gt; &lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;Gunnar Grop CA certificates&amp;quot;&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
   &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;description&lt;/span&gt;
    &lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;This package provides a certificate store containing my own
root and intermediate CA certificates.&amp;quot;&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
   &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;license&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;license:public-domain&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;If you look at the &lt;a href=&quot;https://codeberg.org/guix/guix/src/commit/f250e74dd4a4ba2e7f4a62369bf04c1b06756f9c/gnu/packages/certs.scm#L129&quot;&gt;le-certs&lt;/a&gt; package you can see that mine is basically a straight copy.
The main difference being that my inputs (.pem files) come from local files, instead of being
downloaded from the internet.&lt;/p&gt;&lt;p&gt;Anyway, after adding my own channel to &lt;code&gt;/.config/guix/channels.scm&lt;/code&gt; I just added &lt;code&gt;grop-certs&lt;/code&gt;
to my systems packages definition:&lt;/p&gt;&lt;pre&gt;&lt;code&gt;&lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;use-modules&lt;/span&gt; &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;gunnargrop&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;packages&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;pki&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;syntax-comment&quot;&gt;; ...
&lt;/span&gt;&lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;packages&lt;/span&gt; &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;append&lt;/span&gt; &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;list&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;curl&lt;/span&gt;
                        &lt;span class=&quot;syntax-symbol&quot;&gt;grop-certs&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
                  &lt;span class=&quot;syntax-symbol&quot;&gt;%base-packages&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;And &lt;em&gt;voilà&lt;/em&gt;! After a system reconfigure my CA certificates are present in the system
trust bundle, and I can finally use &lt;code&gt;curl&lt;/code&gt; without specifying CA files.&lt;/p&gt;&lt;p&gt;I hope whoever reads this finds it helpful, as I know I struggled with this particular part
of Guix for a long time.&lt;/p&gt;</content></entry><entry><title>Fontconfig problems with Nix on Guix System</title><id>https://grop.dev/posts/fontconfig-problems-with-nix-on-guix-system.html</id><author><name>Gunnar Grop</name><email>gunnar.grop@protonmail.com</email></author><updated>2026-07-20T16:49:00Z</updated><link href="https://grop.dev/posts/fontconfig-problems-with-nix-on-guix-system.html" rel="alternate" /><content type="html">&lt;p&gt;Since I started using &lt;a href=&quot;https://guix.gnu.org/&quot;&gt;Guix System&lt;/a&gt; about a year ago, I've absolutely loved it.
I can easily say it's my favourite OS out of any I've used, thus far.
Although, compared to &lt;a href=&quot;https://nixos.org/&quot;&gt;Nix&lt;/a&gt; (which Guix is based on), it has comparatively few software packages packaged for it.
This is no wonder when considering the &lt;a href=&quot;https://search.nixos.org/packages&quot;&gt;sheer amount of packages&lt;/a&gt; for Nix.&lt;/p&gt;&lt;p&gt;Fortunately this &amp;quot;problem&amp;quot; is easily remedied by just using Nix on Guix System! This is made
extra easy by using the system service &lt;code&gt;nix-service-type&lt;/code&gt; (&lt;a href=&quot;https://guix.gnu.org/manual/1.5.0/en/html_node/Miscellaneous-Services.html&quot;&gt;documentation&lt;/a&gt;).&lt;/p&gt;&lt;p&gt;Now I use Nix on Guix System, mostly using &lt;a href=&quot;https://github.com/nix-community/home-manager&quot;&gt;Home Manager&lt;/a&gt;, and for the most parts it works great.
One of the few problems I've run into is that graphical programs installed via Nix get the wrong fonts,
like they couldn't find any fonts and always used a fallback. In this case, &lt;a href=&quot;https://typeof.net/Iosevka/&quot;&gt;Iosevka&lt;/a&gt;, which I had installed
with Guix. No matter which font packages I installed, every application would use Iosevka.&lt;/p&gt;&lt;p&gt;For example, Firefox (installed via Nix) would log this error whenever started:&lt;/p&gt;&lt;blockquote&gt;&lt;p&gt;Fontconfig error: Cannot load default config file: File not found:&lt;/p&gt;&lt;/blockquote&gt;&lt;p&gt;Turns out that this is a problem with &lt;a href=&quot;https://www.freedesktop.org/wiki/Software/fontconfig/?__goaway_challenge=meta-refresh&amp;amp;__goaway_id=7c20e24f4a4272237f29befdc44945e6&amp;amp;__goaway_referer=https%3A%2F%2Fnoai.duckduckgo.com%2F&quot;&gt;Fontconfig&lt;/a&gt;. Or rather, that Guix and Nix manages their Fontconfig configs
differently. Guix System does not set the environment variables &lt;code&gt;FONTCONFIG_FILE&lt;/code&gt; or &lt;code&gt;FONTCONFIG_PATH&lt;/code&gt;,
which are used by Fontconfig to figure out where configurations are placed. By default, Fontconfig looks
in the directory &lt;code&gt;/etc/fonts&lt;/code&gt; to find fonts and configs, but this is not where Guix places them. Guix instead
places font configuration in the active system configuration directory, under &lt;code&gt;/run/current-system/profile&lt;/code&gt;.&lt;/p&gt;&lt;p&gt;So, to fix the font problems with Nix applications, all we have to do is to set the following environment variables:&lt;/p&gt;&lt;pre&gt;&lt;code&gt;FONTCONFIG_PATH=/run/current-system/profile/etc/fonts
FONTCONFIG_FILE=/run/current-system/profile/etc/fonts/fonts.conf&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;In my case, I opted to do this in my Guix Home configuration, using the &lt;code&gt;home-bash-service-type&lt;/code&gt; service, like so:&lt;/p&gt;&lt;pre&gt;&lt;code&gt;&lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;home-environment&lt;/span&gt;
 &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;services&lt;/span&gt;
  &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;append&lt;/span&gt; &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;list&lt;/span&gt; &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;service&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;home-bash-service-type&lt;/span&gt;
                         &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;home-bash-configuration&lt;/span&gt;
                          &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;environment-variables&lt;/span&gt;
                           &lt;span class=&quot;syntax-symbol&quot;&gt;'&lt;/span&gt;&lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;FONTCONFIG_FILE&amp;quot;&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;.&lt;/span&gt; &lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;/run/current-system/profile/etc/fonts/fonts.conf&amp;quot;&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
                             &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;FONTCONFIG_PATH&amp;quot;&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;.&lt;/span&gt; &lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;/run/current-system/profile/etc/fonts&amp;quot;&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
                &lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
          &lt;span class=&quot;syntax-symbol&quot;&gt;%base-home-services&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;But you can set them however you like.
After the environment variables are set, applications installed with Nix should find your installed fonts.&lt;/p&gt;</content></entry></feed>