<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
    <title>StuckInVim</title>
    <subtitle>Notes from a terminal-centric homelab.</subtitle>
    <link rel="self" type="application/atom+xml" href="https://stuckinvim.io/atom.xml"/>
    <link rel="alternate" type="text/html" href="https://stuckinvim.io"/>
    <generator uri="https://www.getzola.org/">Zola</generator>
    <updated>2026-11-08T00:00:00+00:00</updated>
    <id>https://stuckinvim.io/atom.xml</id>
    <entry xml:lang="en">
        <title>Using Nix to Declare NFS Mounts</title>
        <published>2026-11-08T00:00:00+00:00</published>
        <updated>2026-11-08T00:00:00+00:00</updated>
        
        <author>
          <name>stuck in vim</name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://stuckinvim.io/posts/using-nix-to-declare-nfs-mounts/"/>
        <id>https://stuckinvim.io/posts/using-nix-to-declare-nfs-mounts/</id>
        
        <content type="html" xml:base="https://stuckinvim.io/posts/using-nix-to-declare-nfs-mounts/">&lt;p&gt;Declaring network shares in Nix is much easier and more reliable than doing it by hand. Below is a single share from my homelab, followed by the module I now use to declare each share once and enable it per host.&lt;/p&gt;
&lt;h2 id=&quot;A_single_share&quot;&gt;A single share&lt;/h2&gt;
&lt;p&gt;I declare each share hosted on my unRAID box (&lt;code&gt;dauntless&lt;/code&gt;) individually, so I can add them to my various hosts in a modular way that resembles the principle of least privilege.&lt;/p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #CDD6F4; background-color: #181524;&quot; &gt;&lt;code data-lang=&quot;nix&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #BAC2DE;&quot;&gt;{&lt;/span&gt;&lt;span style=&quot;color: #F5C2E7;&quot;&gt; config&lt;/span&gt;&lt;span style=&quot;color: #89DCEB;&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;color: #F5C2E7;&quot;&gt; pkgs&lt;/span&gt;&lt;span style=&quot;color: #89DCEB;&quot;&gt;, ...&lt;/span&gt;&lt;span style=&quot;color: #BAC2DE;&quot;&gt; }:&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #BAC2DE;&quot;&gt;{&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6C7086;font-style: italic;&quot;&gt;  # dauntless resolves over VPN DNS, which is not up during early boot; retry on access.&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #EBA0AC;&quot;&gt;  fileSystems&lt;/span&gt;&lt;span&gt;.&lt;/span&gt;&lt;span style=&quot;color: #BAC2DE;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #A6E3A1;&quot;&gt;/mnt/unraid/Media&lt;/span&gt;&lt;span style=&quot;color: #BAC2DE;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #89DCEB;&quot;&gt; =&lt;/span&gt;&lt;span style=&quot;color: #BAC2DE;&quot;&gt; {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #EBA0AC;&quot;&gt;    device&lt;/span&gt;&lt;span style=&quot;color: #89DCEB;&quot;&gt; =&lt;/span&gt;&lt;span style=&quot;color: #BAC2DE;&quot;&gt; &amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #A6E3A1;&quot;&gt;dauntless:/mnt/user/Media&lt;/span&gt;&lt;span style=&quot;color: #BAC2DE;&quot;&gt;&amp;quot;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #EBA0AC;&quot;&gt;    fsType&lt;/span&gt;&lt;span style=&quot;color: #89DCEB;&quot;&gt; =&lt;/span&gt;&lt;span style=&quot;color: #BAC2DE;&quot;&gt; &amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #A6E3A1;&quot;&gt;nfs&lt;/span&gt;&lt;span style=&quot;color: #BAC2DE;&quot;&gt;&amp;quot;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #EBA0AC;&quot;&gt;    options&lt;/span&gt;&lt;span style=&quot;color: #89DCEB;&quot;&gt; =&lt;/span&gt;&lt;span style=&quot;color: #BAC2DE;&quot;&gt; [&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #BAC2DE;&quot;&gt;      &amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #A6E3A1;&quot;&gt;nofail&lt;/span&gt;&lt;span style=&quot;color: #BAC2DE;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #BAC2DE;&quot;&gt;      &amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #A6E3A1;&quot;&gt;retry=0&lt;/span&gt;&lt;span style=&quot;color: #BAC2DE;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #BAC2DE;&quot;&gt;      &amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #A6E3A1;&quot;&gt;noatime&lt;/span&gt;&lt;span style=&quot;color: #BAC2DE;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #BAC2DE;&quot;&gt;      &amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #A6E3A1;&quot;&gt;x-systemd.automount&lt;/span&gt;&lt;span style=&quot;color: #BAC2DE;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #BAC2DE;&quot;&gt;      &amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #A6E3A1;&quot;&gt;x-systemd.mount-timeout=15s&lt;/span&gt;&lt;span style=&quot;color: #BAC2DE;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #BAC2DE;&quot;&gt;      &amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #A6E3A1;&quot;&gt;x-systemd.after=tailscaled.service&lt;/span&gt;&lt;span style=&quot;color: #BAC2DE;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #BAC2DE;&quot;&gt;      &amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #A6E3A1;&quot;&gt;x-systemd.after=netbird-default.service&lt;/span&gt;&lt;span style=&quot;color: #BAC2DE;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #BAC2DE;&quot;&gt;    ];&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #BAC2DE;&quot;&gt;  };&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #EBA0AC;&quot;&gt;  boot&lt;/span&gt;&lt;span&gt;.&lt;/span&gt;&lt;span style=&quot;color: #EBA0AC;&quot;&gt;supportedFilesystems&lt;/span&gt;&lt;span style=&quot;color: #89DCEB;&quot;&gt; =&lt;/span&gt;&lt;span style=&quot;color: #BAC2DE;&quot;&gt; [ &amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #A6E3A1;&quot;&gt;nfs&lt;/span&gt;&lt;span style=&quot;color: #BAC2DE;&quot;&gt;&amp;quot; ];&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #BAC2DE;&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;The VPN ordering matters because dauntless resolves over NetBird DNS, which is not up during early boot. &lt;code&gt;x-systemd.automount&lt;/code&gt; means the mount is not attempted at boot at all: the path stays a trigger until something touches it, by which point the tunnel is normally established. The two &lt;code&gt;x-systemd.after=&lt;/code&gt; lines do not pull the VPN in.&lt;/p&gt;
&lt;p&gt;Two options do the actual work when the VPN is not up:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;retry=0&lt;/code&gt; -- &lt;code&gt;mount.nfs&lt;/code&gt; retries a failed foreground mount for two minutes by default, and each retry can itself take minutes over TCP. Zero means give up after the first attempt.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;x-systemd.mount-timeout=15s&lt;/code&gt; -- establishes a cap for how long the generated mount unit waits for the mount command before killing it.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Without both, a dead tunnel can block a shell on first access for several minutes. The full list of NFS-specific options lives in &lt;code&gt;mount.nfs(8)&lt;/code&gt; and &lt;code&gt;nfs(5)&lt;/code&gt;; for the generic ones I&#39;ve also used &lt;a rel=&quot;external&quot; href=&quot;https://man.archlinux.org/man/mount.8#Generic_Mount_Options&quot;&gt;Arch Linux&#39;s documentation&lt;/a&gt;.&lt;/p&gt;
&lt;h2 id=&quot;Verifying_an_automount&quot;&gt;Verifying an automount&lt;/h2&gt;
&lt;p&gt;&lt;code&gt;df -h&lt;/code&gt; and &lt;code&gt;duf&lt;/code&gt; are the tools I reach for, but they read the mount table, and with automount what is there is the autofs stub rather than the share. To verify the declaration (replacing my mount with yours):&lt;/p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #CDD6F4; background-color: #181524;&quot; &gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;systemctl status mnt-unraid-Media.automount&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;ls /mnt/unraid/Media&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;findmnt /mnt/unraid/Media&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;The first shows the trigger is armed, the second triggers the mount, the third shows whether or not it landed.&lt;/p&gt;
&lt;h2 id=&quot;Many_shares&quot;&gt;Many shares&lt;/h2&gt;
&lt;p&gt;The issue I ended up bumping into is that one &lt;code&gt;fileSystems&lt;/code&gt; block per share works until it does not. As of writing this, I have six of them. This means six copies of the same option list. While it wasn&#39;t severe, I did start to see them drift: one share had &lt;code&gt;timeo&lt;/code&gt; and &lt;code&gt;sync&lt;/code&gt; because it holds git repositories, the others had neither, and nothing in the host file said which was deliberate. Besides that, fewer file imports that are accomplishing functionally the same thing throughout my config feels cleaner.&lt;/p&gt;
&lt;p&gt;The replacement is an option module that takes a list per host. The share name, mountpoint and device are derived; only the differences are declared.&lt;/p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #CDD6F4; background-color: #181524;&quot; &gt;&lt;code data-lang=&quot;nix&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F5C2E7;&quot;&gt;homelab&lt;/span&gt;&lt;span style=&quot;color: #89DCEB;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #F5C2E7;&quot;&gt;nfs-shares&lt;/span&gt;&lt;span style=&quot;color: #89DCEB;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #F5C2E7;&quot;&gt;shares&lt;/span&gt;&lt;span style=&quot;color: #F38BA8;&quot;&gt; =&lt;/span&gt;&lt;span style=&quot;color: #BAC2DE;&quot;&gt; [&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #BAC2DE;&quot;&gt;  {&lt;/span&gt;&lt;span style=&quot;color: #EBA0AC;&quot;&gt; share&lt;/span&gt;&lt;span style=&quot;color: #89DCEB;&quot;&gt; =&lt;/span&gt;&lt;span style=&quot;color: #BAC2DE;&quot;&gt; &amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #A6E3A1;&quot;&gt;Docker&lt;/span&gt;&lt;span style=&quot;color: #BAC2DE;&quot;&gt;&amp;quot;; }&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #BAC2DE;&quot;&gt;  {&lt;/span&gt;&lt;span style=&quot;color: #EBA0AC;&quot;&gt; share&lt;/span&gt;&lt;span style=&quot;color: #89DCEB;&quot;&gt; =&lt;/span&gt;&lt;span style=&quot;color: #BAC2DE;&quot;&gt; &amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #A6E3A1;&quot;&gt;Gitea&lt;/span&gt;&lt;span style=&quot;color: #BAC2DE;&quot;&gt;&amp;quot;;&lt;/span&gt;&lt;span style=&quot;color: #EBA0AC;&quot;&gt; extraOptions&lt;/span&gt;&lt;span style=&quot;color: #89DCEB;&quot;&gt; =&lt;/span&gt;&lt;span style=&quot;color: #BAC2DE;&quot;&gt; [ &amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #A6E3A1;&quot;&gt;sync&lt;/span&gt;&lt;span style=&quot;color: #BAC2DE;&quot;&gt;&amp;quot; ]; }&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #BAC2DE;&quot;&gt;  {&lt;/span&gt;&lt;span style=&quot;color: #EBA0AC;&quot;&gt; share&lt;/span&gt;&lt;span style=&quot;color: #89DCEB;&quot;&gt; =&lt;/span&gt;&lt;span style=&quot;color: #BAC2DE;&quot;&gt; &amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #A6E3A1;&quot;&gt;Media&lt;/span&gt;&lt;span style=&quot;color: #BAC2DE;&quot;&gt;&amp;quot;;&lt;/span&gt;&lt;span style=&quot;color: #EBA0AC;&quot;&gt; workloadClass&lt;/span&gt;&lt;span style=&quot;color: #89DCEB;&quot;&gt; =&lt;/span&gt;&lt;span style=&quot;color: #BAC2DE;&quot;&gt; &amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #A6E3A1;&quot;&gt;read-mostly&lt;/span&gt;&lt;span style=&quot;color: #BAC2DE;&quot;&gt;&amp;quot;; }&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #BAC2DE;&quot;&gt;  {&lt;/span&gt;&lt;span style=&quot;color: #EBA0AC;&quot;&gt; share&lt;/span&gt;&lt;span style=&quot;color: #89DCEB;&quot;&gt; =&lt;/span&gt;&lt;span style=&quot;color: #BAC2DE;&quot;&gt; &amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #A6E3A1;&quot;&gt;Other&lt;/span&gt;&lt;span style=&quot;color: #BAC2DE;&quot;&gt;&amp;quot;; }&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #BAC2DE;&quot;&gt;  {&lt;/span&gt;&lt;span style=&quot;color: #EBA0AC;&quot;&gt; share&lt;/span&gt;&lt;span style=&quot;color: #89DCEB;&quot;&gt; =&lt;/span&gt;&lt;span style=&quot;color: #BAC2DE;&quot;&gt; &amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #A6E3A1;&quot;&gt;Nextcloud/data&lt;/span&gt;&lt;span style=&quot;color: #BAC2DE;&quot;&gt;&amp;quot;;&lt;/span&gt;&lt;span style=&quot;color: #EBA0AC;&quot;&gt; mountPoint&lt;/span&gt;&lt;span style=&quot;color: #89DCEB;&quot;&gt; =&lt;/span&gt;&lt;span style=&quot;color: #BAC2DE;&quot;&gt; &amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #A6E3A1;&quot;&gt;/var/lib/nextcloud/data&lt;/span&gt;&lt;span style=&quot;color: #BAC2DE;&quot;&gt;&amp;quot;; }&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #BAC2DE;&quot;&gt;]&lt;/span&gt;&lt;span style=&quot;color: #F38BA8;&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;A share that is not in the list generates no mount unit and no automount unit at all -- the path does not exist on that host. Nothing is shared implicitly.&lt;/p&gt;
&lt;p&gt;The module itself is small, but offers valuable mapping:&lt;/p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #CDD6F4; background-color: #181524;&quot; &gt;&lt;code data-lang=&quot;nix&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F5C2E7;&quot;&gt;fileSystems&lt;/span&gt;&lt;span style=&quot;color: #F38BA8;&quot;&gt; =&lt;/span&gt;&lt;span style=&quot;color: #F5C2E7;&quot;&gt; listToAttrs&lt;/span&gt;&lt;span style=&quot;color: #BAC2DE;&quot;&gt; (&lt;/span&gt;&lt;span style=&quot;color: #89B4FA;&quot;&gt;map&lt;/span&gt;&lt;span style=&quot;color: #BAC2DE;&quot;&gt; (&lt;/span&gt;&lt;span style=&quot;color: #F5C2E7;&quot;&gt;share&lt;/span&gt;&lt;span style=&quot;color: #BAC2DE;&quot;&gt;:&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F5C2E7;&quot;&gt;  nameValuePair share&lt;/span&gt;&lt;span style=&quot;color: #89DCEB;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #F5C2E7;&quot;&gt;mountPoint&lt;/span&gt;&lt;span style=&quot;color: #BAC2DE;&quot;&gt; {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #EBA0AC;&quot;&gt;    device&lt;/span&gt;&lt;span style=&quot;color: #89DCEB;&quot;&gt; =&lt;/span&gt;&lt;span style=&quot;color: #BAC2DE;&quot;&gt; &amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #A6E3A1;&quot;&gt;dauntless:/mnt/user/&lt;/span&gt;&lt;span style=&quot;color: #BAC2DE;&quot;&gt;${&lt;/span&gt;&lt;span style=&quot;color: #F5C2E7;&quot;&gt;share&lt;/span&gt;&lt;span style=&quot;color: #89DCEB;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #F5C2E7;&quot;&gt;share&lt;/span&gt;&lt;span style=&quot;color: #BAC2DE;&quot;&gt;}&amp;quot;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #EBA0AC;&quot;&gt;    fsType&lt;/span&gt;&lt;span style=&quot;color: #89DCEB;&quot;&gt; =&lt;/span&gt;&lt;span style=&quot;color: #BAC2DE;&quot;&gt; &amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #A6E3A1;&quot;&gt;nfs&lt;/span&gt;&lt;span style=&quot;color: #BAC2DE;&quot;&gt;&amp;quot;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #EBA0AC;&quot;&gt;    options&lt;/span&gt;&lt;span style=&quot;color: #89DCEB;&quot;&gt; =&lt;/span&gt;&lt;span style=&quot;color: #F5C2E7;&quot;&gt; unique&lt;/span&gt;&lt;span style=&quot;color: #BAC2DE;&quot;&gt; (&lt;/span&gt;&lt;span style=&quot;color: #F5C2E7;&quot;&gt;commonOptions&lt;/span&gt;&lt;span style=&quot;color: #89DCEB;&quot;&gt; ++&lt;/span&gt;&lt;span style=&quot;color: #F5C2E7;&quot;&gt; policies&lt;/span&gt;&lt;span style=&quot;color: #89DCEB;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #BAC2DE;&quot;&gt;${&lt;/span&gt;&lt;span style=&quot;color: #F5C2E7;&quot;&gt;share&lt;/span&gt;&lt;span style=&quot;color: #89DCEB;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #F5C2E7;&quot;&gt;workloadClass&lt;/span&gt;&lt;span style=&quot;color: #BAC2DE;&quot;&gt;}&lt;/span&gt;&lt;span style=&quot;color: #89DCEB;&quot;&gt; ++&lt;/span&gt;&lt;span style=&quot;color: #F5C2E7;&quot;&gt; share&lt;/span&gt;&lt;span style=&quot;color: #89DCEB;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #F5C2E7;&quot;&gt;extraOptions&lt;/span&gt;&lt;span style=&quot;color: #BAC2DE;&quot;&gt;);&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #BAC2DE;&quot;&gt;  }&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #BAC2DE;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: #F5C2E7;&quot;&gt; cfg&lt;/span&gt;&lt;span style=&quot;color: #89DCEB;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #F5C2E7;&quot;&gt;shares&lt;/span&gt;&lt;span style=&quot;color: #BAC2DE;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: #F38BA8;&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;code&gt;commonOptions&lt;/code&gt; carries the automount, the VPN ordering, &lt;code&gt;retry=0&lt;/code&gt; and &lt;code&gt;x-systemd.mount-timeout&lt;/code&gt;, so every share inherits them. The rest depends on what the share is for:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;write-critical&lt;/code&gt; (the default) -- &lt;code&gt;hard&lt;/code&gt;, &lt;code&gt;timeo=600&lt;/code&gt;, &lt;code&gt;retrans=2&lt;/code&gt;, &lt;code&gt;actimeo=1&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;read-mostly&lt;/code&gt; -- &lt;code&gt;softerr&lt;/code&gt;, &lt;code&gt;timeo=10&lt;/code&gt;, &lt;code&gt;retrans=2&lt;/code&gt;, &lt;code&gt;actimeo=5&lt;/code&gt;, which returns &lt;code&gt;ETIMEDOUT&lt;/code&gt; after the retransmissions are exhausted.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The split exists because a soft or &lt;code&gt;softerr&lt;/code&gt; mount can return an error for a write the server already committed. That is fine for a media library this host only reads, but totally unacceptable for a git repository or Nextcloud&#39;s data directory. A share only qualifies for read-mostly if nothing on that host writes to it.&lt;/p&gt;
&lt;p&gt;One thing that can still trip up successful mounting: hard mounts still block indefinitely if the link drops after the mount is established. No mount option gives both write integrity and fail-fast writes, so these timeouts are stuck addressing the attempt, but can&#39;t address anything around maintaining the mount.&lt;/p&gt;
&lt;p&gt;Per-host lists are least privilege at the mount layer, but this doesn&#39;t address anything on the host serving the share. If the export is visible to your whole VPN subnet, any host on it can still mount the share. If you care, you&#39;d need to set up restrictions on the host itself preventing unwanted access -- either through auth or network access.&lt;/p&gt;
</content>
        
    </entry>
    <entry xml:lang="en">
        <title>Deploying Comin for Nix GitOps</title>
        <published>2026-11-07T00:00:00+00:00</published>
        <updated>2026-11-07T00:00:00+00:00</updated>
        
        <author>
          <name>stuck in vim</name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://stuckinvim.io/posts/deploying-comin-for-nix-gitops/"/>
        <id>https://stuckinvim.io/posts/deploying-comin-for-nix-gitops/</id>
        
        <content type="html" xml:base="https://stuckinvim.io/posts/deploying-comin-for-nix-gitops/">&lt;p&gt;Below is all you need (customized to preference, of course) to deploy &lt;a rel=&quot;external&quot; href=&quot;https://github.com/nlewo/comin&quot;&gt;Comin&lt;/a&gt; for handling NixOS gitops. It&#39;s worth noting that you should employ proper controls around your git repo that you build from, as this configuration doesn&#39;t do anything except deploy what it sees.&lt;/p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #CDD6F4; background-color: #181524;&quot; &gt;&lt;code data-lang=&quot;nix&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #BAC2DE;&quot;&gt;{&lt;/span&gt;&lt;span style=&quot;color: #F5C2E7;&quot;&gt; config&lt;/span&gt;&lt;span style=&quot;color: #89DCEB;&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;color: #F5C2E7;&quot;&gt; pkgs&lt;/span&gt;&lt;span style=&quot;color: #89DCEB;&quot;&gt;, ...&lt;/span&gt;&lt;span style=&quot;color: #BAC2DE;&quot;&gt; }:&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #BAC2DE;&quot;&gt;{&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #EBA0AC;&quot;&gt;  services&lt;/span&gt;&lt;span&gt;.&lt;/span&gt;&lt;span style=&quot;color: #EBA0AC;&quot;&gt;comin&lt;/span&gt;&lt;span style=&quot;color: #89DCEB;&quot;&gt; =&lt;/span&gt;&lt;span style=&quot;color: #BAC2DE;&quot;&gt; {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #EBA0AC;&quot;&gt;    enable&lt;/span&gt;&lt;span style=&quot;color: #89DCEB;&quot;&gt; =&lt;/span&gt;&lt;span style=&quot;color: #FAB387;&quot;&gt; true&lt;/span&gt;&lt;span style=&quot;color: #BAC2DE;&quot;&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #EBA0AC;&quot;&gt;    hostname&lt;/span&gt;&lt;span style=&quot;color: #89DCEB;&quot;&gt; =&lt;/span&gt;&lt;span style=&quot;color: #F5C2E7;&quot;&gt; config&lt;/span&gt;&lt;span style=&quot;color: #89DCEB;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #F5C2E7;&quot;&gt;networking&lt;/span&gt;&lt;span style=&quot;color: #89DCEB;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #F5C2E7;&quot;&gt;hostName&lt;/span&gt;&lt;span style=&quot;color: #BAC2DE;&quot;&gt;;&lt;/span&gt;&lt;span style=&quot;color: #6C7086;font-style: italic;&quot;&gt; # hostname of &amp;#39;this&amp;#39; device&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #EBA0AC;&quot;&gt;    remotes&lt;/span&gt;&lt;span style=&quot;color: #89DCEB;&quot;&gt; =&lt;/span&gt;&lt;span style=&quot;color: #BAC2DE;&quot;&gt; [{&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #EBA0AC;&quot;&gt;      name&lt;/span&gt;&lt;span style=&quot;color: #89DCEB;&quot;&gt; =&lt;/span&gt;&lt;span style=&quot;color: #BAC2DE;&quot;&gt; &amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #A6E3A1;&quot;&gt;origin&lt;/span&gt;&lt;span style=&quot;color: #BAC2DE;&quot;&gt;&amp;quot;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #EBA0AC;&quot;&gt;      url&lt;/span&gt;&lt;span style=&quot;color: #89DCEB;&quot;&gt; =&lt;/span&gt;&lt;span style=&quot;color: #BAC2DE;&quot;&gt; &amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #A6E3A1;&quot;&gt;https://github.com/sprjr/nixos-configs.git&lt;/span&gt;&lt;span style=&quot;color: #BAC2DE;&quot;&gt;&amp;quot;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #EBA0AC;&quot;&gt;      branches&lt;/span&gt;&lt;span&gt;.&lt;/span&gt;&lt;span style=&quot;color: #EBA0AC;&quot;&gt;main&lt;/span&gt;&lt;span&gt;.&lt;/span&gt;&lt;span style=&quot;color: #EBA0AC;&quot;&gt;name&lt;/span&gt;&lt;span style=&quot;color: #89DCEB;&quot;&gt; =&lt;/span&gt;&lt;span style=&quot;color: #BAC2DE;&quot;&gt; &amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #A6E3A1;&quot;&gt;main&lt;/span&gt;&lt;span style=&quot;color: #BAC2DE;&quot;&gt;&amp;quot;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #EBA0AC;&quot;&gt;      poller&lt;/span&gt;&lt;span&gt;.&lt;/span&gt;&lt;span style=&quot;color: #EBA0AC;&quot;&gt;period&lt;/span&gt;&lt;span style=&quot;color: #89DCEB;&quot;&gt; =&lt;/span&gt;&lt;span style=&quot;color: #FAB387;&quot;&gt; 60&lt;/span&gt;&lt;span style=&quot;color: #BAC2DE;&quot;&gt;;&lt;/span&gt;&lt;span style=&quot;color: #6C7086;font-style: italic;&quot;&gt; # seconds&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #BAC2DE;&quot;&gt;    }];&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #BAC2DE;&quot;&gt;  };&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #BAC2DE;&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&quot;|_Visibility&quot;&gt;| Visibility&lt;/h2&gt;
&lt;p&gt;Comin is a wonderful, if fairly straightforward and simple, way to manage gitops and build automation for Nix resources.&lt;/p&gt;
&lt;p&gt;I found that visibility into the build state of my systems managed by comin were not very great by default. So, I wrote a nix-managed Python script that gets and pushes build states to a ntfy url/topic for me to get notification on build failures. It even incorporates a bit of sops, just for fun. I also created a Grafana dashboard, and created a widget for my hyprland + waybar config.&lt;/p&gt;
&lt;h2 id=&quot;|_Grafana_stack&quot;&gt;| Grafana stack&lt;/h2&gt;
&lt;p&gt;Instead of putting the entire json file for the Grafana dashboard here, I&#39;ll just link the file:
&lt;a rel=&quot;external&quot; href=&quot;https://github.com/sprjr/nixos-configs/nixos/modules/monitoring/dashboards/nix-state.json&quot;&gt;Grafana Nix State Dashboard&lt;/a&gt;&lt;/p&gt;
&lt;h2 id=&quot;|_Ntfy&quot;&gt;| Ntfy&lt;/h2&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #CDD6F4; background-color: #181524;&quot; &gt;&lt;code data-lang=&quot;nix&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #BAC2DE;&quot;&gt;{&lt;/span&gt;&lt;span style=&quot;color: #F5C2E7;&quot;&gt; config&lt;/span&gt;&lt;span style=&quot;color: #89DCEB;&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;color: #F5C2E7;&quot;&gt; pkgs&lt;/span&gt;&lt;span style=&quot;color: #89DCEB;&quot;&gt;, ...&lt;/span&gt;&lt;span style=&quot;color: #BAC2DE;&quot;&gt; }:&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #CBA6F7;&quot;&gt;let&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #EBA0AC;&quot;&gt;  ntfyUrlFile&lt;/span&gt;&lt;span style=&quot;color: #89DCEB;&quot;&gt; =&lt;/span&gt;&lt;span style=&quot;color: #F5C2E7;&quot;&gt; config&lt;/span&gt;&lt;span style=&quot;color: #89DCEB;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #F5C2E7;&quot;&gt;sops&lt;/span&gt;&lt;span style=&quot;color: #89DCEB;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #F5C2E7;&quot;&gt;secrets&lt;/span&gt;&lt;span style=&quot;color: #89DCEB;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #BAC2DE;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #A6E3A1;&quot;&gt;monitoring/ntfy/comin-url&lt;/span&gt;&lt;span style=&quot;color: #BAC2DE;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #89DCEB;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #F5C2E7;&quot;&gt;path&lt;/span&gt;&lt;span style=&quot;color: #BAC2DE;&quot;&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #EBA0AC;&quot;&gt;  cominNotify&lt;/span&gt;&lt;span style=&quot;color: #89DCEB;&quot;&gt; =&lt;/span&gt;&lt;span style=&quot;color: #F5C2E7;&quot;&gt; pkgs&lt;/span&gt;&lt;span style=&quot;color: #89DCEB;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #F5C2E7;&quot;&gt;writeScript&lt;/span&gt;&lt;span style=&quot;color: #BAC2DE;&quot;&gt; &amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #A6E3A1;&quot;&gt;comin-notify.py&lt;/span&gt;&lt;span style=&quot;color: #BAC2DE;&quot;&gt;&amp;quot; &amp;#39;&amp;#39;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #A6E3A1;&quot;&gt;    #!&lt;/span&gt;&lt;span style=&quot;color: #BAC2DE;&quot;&gt;${&lt;/span&gt;&lt;span style=&quot;color: #F5C2E7;&quot;&gt;pkgs&lt;/span&gt;&lt;span style=&quot;color: #89DCEB;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #F5C2E7;&quot;&gt;python3&lt;/span&gt;&lt;span style=&quot;color: #BAC2DE;&quot;&gt;}&lt;/span&gt;&lt;span style=&quot;color: #A6E3A1;&quot;&gt;/bin/python3&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #A6E3A1;&quot;&gt;    import subprocess, json, os, sys&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #A6E3A1;&quot;&gt;    hostname = &amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #BAC2DE;&quot;&gt;${&lt;/span&gt;&lt;span style=&quot;color: #F5C2E7;&quot;&gt;config&lt;/span&gt;&lt;span style=&quot;color: #89DCEB;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #F5C2E7;&quot;&gt;networking&lt;/span&gt;&lt;span style=&quot;color: #89DCEB;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #F5C2E7;&quot;&gt;hostName&lt;/span&gt;&lt;span style=&quot;color: #BAC2DE;&quot;&gt;}&lt;/span&gt;&lt;span style=&quot;color: #A6E3A1;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #A6E3A1;&quot;&gt;    with open(&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #BAC2DE;&quot;&gt;${&lt;/span&gt;&lt;span style=&quot;color: #F5C2E7;&quot;&gt;ntfyUrlFile&lt;/span&gt;&lt;span style=&quot;color: #BAC2DE;&quot;&gt;}&lt;/span&gt;&lt;span style=&quot;color: #A6E3A1;&quot;&gt;&amp;quot;) as f:&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #A6E3A1;&quot;&gt;        ntfy_url = f.read().strip()&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #A6E3A1;&quot;&gt;    state_file = &amp;quot;/var/lib/comin-notify/state.json&amp;quot;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #A6E3A1;&quot;&gt;    def get_status():&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #A6E3A1;&quot;&gt;        r = subprocess.run([&amp;quot;comin&amp;quot;, &amp;quot;status&amp;quot;, &amp;quot;--json&amp;quot;], capture_output=True, text=True)&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #A6E3A1;&quot;&gt;        if r.returncode != 0:&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #A6E3A1;&quot;&gt;            print(f&amp;quot;comin status failed: {r.stderr}&amp;quot;, file=sys.stderr)&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #A6E3A1;&quot;&gt;            return None&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #A6E3A1;&quot;&gt;        return json.loads(r.stdout)&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #A6E3A1;&quot;&gt;    def publish(msg, priority=None, tags=None):&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #A6E3A1;&quot;&gt;        args = [&amp;quot;ntfy&amp;quot;, &amp;quot;publish&amp;quot;]&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #A6E3A1;&quot;&gt;        if priority:&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #A6E3A1;&quot;&gt;            args += [&amp;quot;--priority&amp;quot;, priority]&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #A6E3A1;&quot;&gt;        if tags:&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #A6E3A1;&quot;&gt;            args += [&amp;quot;--tags&amp;quot;, tags]&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #A6E3A1;&quot;&gt;        args += [ntfy_url, msg]&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #A6E3A1;&quot;&gt;        r = subprocess.run(args, capture_output=True, text=True)&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #A6E3A1;&quot;&gt;        if r.returncode != 0:&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #A6E3A1;&quot;&gt;            print(f&amp;quot;ntfy publish failed: {r.stderr}&amp;quot;, file=sys.stderr)&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #A6E3A1;&quot;&gt;    def load_state():&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #A6E3A1;&quot;&gt;        if os.path.exists(state_file):&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #A6E3A1;&quot;&gt;            with open(state_file) as f:&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #A6E3A1;&quot;&gt;                return json.load(f)&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #A6E3A1;&quot;&gt;        return {&amp;quot;last_commit_id&amp;quot;: &amp;quot;&amp;quot;, &amp;quot;last_failure_commit_id&amp;quot;: &amp;quot;&amp;quot;}&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #A6E3A1;&quot;&gt;    def save_state(state):&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #A6E3A1;&quot;&gt;        with open(state_file, &amp;quot;w&amp;quot;) as f:&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #A6E3A1;&quot;&gt;            json.dump(state, f)&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #A6E3A1;&quot;&gt;    # current comin nests commit metadata under source.git; released 0.14.0 and older keep it top-level&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #A6E3A1;&quot;&gt;    def git_field(gen, key):&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #A6E3A1;&quot;&gt;        git = ((gen or {}).get(&amp;quot;source&amp;quot;) or {}).get(&amp;quot;git&amp;quot;) or {}&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #A6E3A1;&quot;&gt;        return git.get(key) or (gen or {}).get(key) or &amp;quot;&amp;quot;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #A6E3A1;&quot;&gt;    def fetched_commit(status):&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #A6E3A1;&quot;&gt;        try:&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #A6E3A1;&quot;&gt;            with open(&amp;quot;/var/lib/comin/repository/refs/remotes/origin/main&amp;quot;) as f:&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #A6E3A1;&quot;&gt;                return f.read().strip()&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #A6E3A1;&quot;&gt;        except OSError:&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #A6E3A1;&quot;&gt;            fetcher = status.get(&amp;quot;fetcher&amp;quot;) or {}&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #A6E3A1;&quot;&gt;            repo = fetcher.get(&amp;quot;git_repository_status&amp;quot;) or fetcher.get(&amp;quot;repository_status&amp;quot;) or {}&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #A6E3A1;&quot;&gt;            return repo.get(&amp;quot;selected_commit_id&amp;quot;, &amp;quot;&amp;quot;)&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #A6E3A1;&quot;&gt;    def check_failure(status):&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #A6E3A1;&quot;&gt;        gen = (status.get(&amp;quot;builder&amp;quot;) or {}).get(&amp;quot;generation&amp;quot;) or {}&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #A6E3A1;&quot;&gt;        if gen.get(&amp;quot;eval_status&amp;quot;) == &amp;quot;failed&amp;quot;:&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #A6E3A1;&quot;&gt;            return git_field(gen, &amp;quot;selected_commit_id&amp;quot;), &amp;quot;eval failed: &amp;quot; + gen.get(&amp;quot;eval_err&amp;quot;, &amp;quot;&amp;quot;).strip()&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #A6E3A1;&quot;&gt;        if gen.get(&amp;quot;build_status&amp;quot;) == &amp;quot;failed&amp;quot;:&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #A6E3A1;&quot;&gt;            return git_field(gen, &amp;quot;selected_commit_id&amp;quot;), &amp;quot;build failed: &amp;quot; + gen.get(&amp;quot;build_err&amp;quot;, &amp;quot;&amp;quot;).strip()&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #A6E3A1;&quot;&gt;        dep = (status.get(&amp;quot;deployer&amp;quot;) or {}).get(&amp;quot;deployment&amp;quot;) or {}&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #A6E3A1;&quot;&gt;        if dep.get(&amp;quot;status&amp;quot;) == &amp;quot;failed&amp;quot;:&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #A6E3A1;&quot;&gt;            return git_field(dep.get(&amp;quot;generation&amp;quot;), &amp;quot;selected_commit_id&amp;quot;), &amp;quot;switch failed&amp;quot;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #A6E3A1;&quot;&gt;        return None, None&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #A6E3A1;&quot;&gt;    status = get_status()&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #A6E3A1;&quot;&gt;    if status is None:&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #A6E3A1;&quot;&gt;        sys.exit(1)&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #A6E3A1;&quot;&gt;    state = load_state()&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #A6E3A1;&quot;&gt;    fetcher_commit = fetched_commit(status)&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #A6E3A1;&quot;&gt;    if fetcher_commit and fetcher_commit != state[&amp;quot;last_commit_id&amp;quot;]:&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #A6E3A1;&quot;&gt;        gen = (status.get(&amp;quot;builder&amp;quot;) or {}).get(&amp;quot;generation&amp;quot;) or {}&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #A6E3A1;&quot;&gt;        commit_msg = git_field(gen, &amp;quot;selected_commit_msg&amp;quot;).split(&amp;quot;\n&amp;quot;)[0]&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #A6E3A1;&quot;&gt;        publish(f&amp;quot;[{hostname}] new commit {fetcher_commit[:8]}: {commit_msg}&amp;quot;, tags=&amp;quot;arrow_up&amp;quot;)&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #A6E3A1;&quot;&gt;        state[&amp;quot;last_commit_id&amp;quot;] = fetcher_commit&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #A6E3A1;&quot;&gt;    fail_commit, fail_desc = check_failure(status)&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #A6E3A1;&quot;&gt;    if fail_commit and fail_commit != state.get(&amp;quot;last_failure_commit_id&amp;quot;, &amp;quot;&amp;quot;):&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #A6E3A1;&quot;&gt;        publish(f&amp;quot;[{hostname}] FAILED @ {fail_commit[:8]}: {fail_desc}&amp;quot;, priority=&amp;quot;high&amp;quot;, tags=&amp;quot;rotating_light&amp;quot;)&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #A6E3A1;&quot;&gt;        state[&amp;quot;last_failure_commit_id&amp;quot;] = fail_commit&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #A6E3A1;&quot;&gt;    save_state(state)&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #BAC2DE;&quot;&gt;  &amp;#39;&amp;#39;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #CBA6F7;&quot;&gt;in&lt;/span&gt;&lt;span style=&quot;color: #BAC2DE;&quot;&gt; {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6C7086;font-style: italic;&quot;&gt;  # Root-owned 0400; the unit below runs as root.&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #EBA0AC;&quot;&gt;  sops&lt;/span&gt;&lt;span&gt;.&lt;/span&gt;&lt;span style=&quot;color: #EBA0AC;&quot;&gt;secrets&lt;/span&gt;&lt;span&gt;.&lt;/span&gt;&lt;span style=&quot;color: #BAC2DE;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #A6E3A1;&quot;&gt;monitoring/ntfy/comin-url&lt;/span&gt;&lt;span style=&quot;color: #BAC2DE;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #89DCEB;&quot;&gt; =&lt;/span&gt;&lt;span style=&quot;color: #BAC2DE;&quot;&gt; { };&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #EBA0AC;&quot;&gt;  systemd&lt;/span&gt;&lt;span&gt;.&lt;/span&gt;&lt;span style=&quot;color: #EBA0AC;&quot;&gt;services&lt;/span&gt;&lt;span&gt;.&lt;/span&gt;&lt;span style=&quot;color: #EBA0AC;&quot;&gt;comin-notify&lt;/span&gt;&lt;span style=&quot;color: #89DCEB;&quot;&gt; =&lt;/span&gt;&lt;span style=&quot;color: #BAC2DE;&quot;&gt; {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #EBA0AC;&quot;&gt;    description&lt;/span&gt;&lt;span style=&quot;color: #89DCEB;&quot;&gt; =&lt;/span&gt;&lt;span style=&quot;color: #BAC2DE;&quot;&gt; &amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #A6E3A1;&quot;&gt;Check comin deployment status and send ntfy alerts&lt;/span&gt;&lt;span style=&quot;color: #BAC2DE;&quot;&gt;&amp;quot;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #EBA0AC;&quot;&gt;    path&lt;/span&gt;&lt;span style=&quot;color: #89DCEB;&quot;&gt; =&lt;/span&gt;&lt;span style=&quot;color: #BAC2DE;&quot;&gt; [&lt;/span&gt;&lt;span style=&quot;color: #F5C2E7;&quot;&gt; config&lt;/span&gt;&lt;span style=&quot;color: #89DCEB;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #F5C2E7;&quot;&gt;services&lt;/span&gt;&lt;span style=&quot;color: #89DCEB;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #F5C2E7;&quot;&gt;comin&lt;/span&gt;&lt;span style=&quot;color: #89DCEB;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #F5C2E7;&quot;&gt;package pkgs&lt;/span&gt;&lt;span style=&quot;color: #89DCEB;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #F5C2E7;&quot;&gt;ntfy-sh&lt;/span&gt;&lt;span style=&quot;color: #BAC2DE;&quot;&gt; ];&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #EBA0AC;&quot;&gt;    serviceConfig&lt;/span&gt;&lt;span style=&quot;color: #89DCEB;&quot;&gt; =&lt;/span&gt;&lt;span style=&quot;color: #BAC2DE;&quot;&gt; {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #EBA0AC;&quot;&gt;      Type&lt;/span&gt;&lt;span style=&quot;color: #89DCEB;&quot;&gt; =&lt;/span&gt;&lt;span style=&quot;color: #BAC2DE;&quot;&gt; &amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #A6E3A1;&quot;&gt;oneshot&lt;/span&gt;&lt;span style=&quot;color: #BAC2DE;&quot;&gt;&amp;quot;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #EBA0AC;&quot;&gt;      ExecStart&lt;/span&gt;&lt;span style=&quot;color: #89DCEB;&quot;&gt; =&lt;/span&gt;&lt;span style=&quot;color: #BAC2DE;&quot;&gt; &amp;quot;${&lt;/span&gt;&lt;span style=&quot;color: #F5C2E7;&quot;&gt;cominNotify&lt;/span&gt;&lt;span style=&quot;color: #BAC2DE;&quot;&gt;}&amp;quot;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #EBA0AC;&quot;&gt;      StateDirectory&lt;/span&gt;&lt;span style=&quot;color: #89DCEB;&quot;&gt; =&lt;/span&gt;&lt;span style=&quot;color: #BAC2DE;&quot;&gt; &amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #A6E3A1;&quot;&gt;comin-notify&lt;/span&gt;&lt;span style=&quot;color: #BAC2DE;&quot;&gt;&amp;quot;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #BAC2DE;&quot;&gt;    };&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #BAC2DE;&quot;&gt;  };&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #EBA0AC;&quot;&gt;  systemd&lt;/span&gt;&lt;span&gt;.&lt;/span&gt;&lt;span style=&quot;color: #EBA0AC;&quot;&gt;timers&lt;/span&gt;&lt;span&gt;.&lt;/span&gt;&lt;span style=&quot;color: #EBA0AC;&quot;&gt;comin-notify&lt;/span&gt;&lt;span style=&quot;color: #89DCEB;&quot;&gt; =&lt;/span&gt;&lt;span style=&quot;color: #BAC2DE;&quot;&gt; {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #EBA0AC;&quot;&gt;    description&lt;/span&gt;&lt;span style=&quot;color: #89DCEB;&quot;&gt; =&lt;/span&gt;&lt;span style=&quot;color: #BAC2DE;&quot;&gt; &amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #A6E3A1;&quot;&gt;Run comin-notify every 2 minutes&lt;/span&gt;&lt;span style=&quot;color: #BAC2DE;&quot;&gt;&amp;quot;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #EBA0AC;&quot;&gt;    wantedBy&lt;/span&gt;&lt;span style=&quot;color: #89DCEB;&quot;&gt; =&lt;/span&gt;&lt;span style=&quot;color: #BAC2DE;&quot;&gt; [ &amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #A6E3A1;&quot;&gt;timers.target&lt;/span&gt;&lt;span style=&quot;color: #BAC2DE;&quot;&gt;&amp;quot; ];&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #EBA0AC;&quot;&gt;    timerConfig&lt;/span&gt;&lt;span style=&quot;color: #89DCEB;&quot;&gt; =&lt;/span&gt;&lt;span style=&quot;color: #BAC2DE;&quot;&gt; {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #EBA0AC;&quot;&gt;      OnBootSec&lt;/span&gt;&lt;span style=&quot;color: #89DCEB;&quot;&gt; =&lt;/span&gt;&lt;span style=&quot;color: #BAC2DE;&quot;&gt; &amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #A6E3A1;&quot;&gt;2min&lt;/span&gt;&lt;span style=&quot;color: #BAC2DE;&quot;&gt;&amp;quot;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #EBA0AC;&quot;&gt;      OnUnitActiveSec&lt;/span&gt;&lt;span style=&quot;color: #89DCEB;&quot;&gt; =&lt;/span&gt;&lt;span style=&quot;color: #BAC2DE;&quot;&gt; &amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #A6E3A1;&quot;&gt;2min&lt;/span&gt;&lt;span style=&quot;color: #BAC2DE;&quot;&gt;&amp;quot;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #BAC2DE;&quot;&gt;    };&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #BAC2DE;&quot;&gt;  };&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #BAC2DE;&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&quot;|_Hyprland_widget&quot;&gt;| Hyprland widget&lt;/h2&gt;
&lt;p&gt;Comin as a systemd service exposes a lot of great data, including the direct build logs (which I also pipe to a logging server) -- I found that grabbing the build state allowed me to write a custom widget in my hyprland config that informed me as to the build state of different hosts. This can all be found in &lt;a rel=&quot;external&quot; href=&quot;https://github.com/sprjr/nixos-configs/tree/main/home/modules/user-space/hyprland/control-center&quot;&gt;my home-manager settings&lt;/a&gt;.&lt;/p&gt;
</content>
        
    </entry>
    <entry xml:lang="en">
        <title>Blacklisting the eMudhra roots on NixOS</title>
        <published>2026-11-06T00:00:00+00:00</published>
        <updated>2026-11-06T00:00:00+00:00</updated>
        
        <author>
          <name>stuck in vim</name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://stuckinvim.io/posts/blacklisting-the-emudhra-roots-on-nixos/"/>
        <id>https://stuckinvim.io/posts/blacklisting-the-emudhra-roots-on-nixos/</id>
        
        <content type="html" xml:base="https://stuckinvim.io/posts/blacklisting-the-emudhra-roots-on-nixos/">&lt;p&gt;I&#39;m publishing this way late, definitely after it actually matters; however, I&#39;ve already implemented the solution, and I didn&#39;t decide to do articles on a personal site until just a few days ago, and this seems like a nice little piece to add and may be useful for future issues with a bit of tailoring.&lt;/p&gt;
&lt;h2 id=&quot;The_Problem&quot;&gt;The Problem&lt;/h2&gt;
&lt;p&gt;There are tons of articles published due to the global and high-impact nature of this issue. Without diving into the nitty-gritty of the issue itself, suffice it to say that a company named eMudhra exited the TLS business after it was shown that eight of its intermediate CA certificates had private keys weak enough to derive from the public certificates.&lt;/p&gt;
&lt;h3 id=&quot;Timeline&quot;&gt;Timeline&lt;/h3&gt;
&lt;p&gt;The issue was flagged by a cybersecurity researcher on 10-17-2026. eMudhra revoked all eight intermediates on 10-18, Sectigo revoked its cross-signed copies the following day, and Mozilla distrusted the emSign ECC Root CA - G3 on 10-20. Five days after the report, eMudhra announced its exit. I personally feel that they&#39;re dodging a lot of the responsibility around their poor implementation of their CA keys (one of which was just the number &#39;4&#39;), but ultimately, leaving this space was an extremely likely outcome regardless of any steps they might have taken prior to announcing their exit.&lt;/p&gt;
&lt;p&gt;In eMudhra&#39;s own account, the affected CAs were revoked within 14 hours of discovery, no end-entity certificates were issued from them, and its infrastructure was not compromised. Kudelski Security, which published the technical advisory, found no evidence of active exploitation; Cloudflare has since documented attempted exploitation against unpatched clients.&lt;/p&gt;
&lt;h2 id=&quot;Solution&quot;&gt;Solution&lt;/h2&gt;
&lt;p&gt;I&#39;m only listing a Nix solution, and it&#39;s incredibly easy. Add the following to your host&#39;s configuration:&lt;/p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #CDD6F4; background-color: #181524;&quot; &gt;&lt;code data-lang=&quot;nix&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F5C2E7;&quot;&gt;security&lt;/span&gt;&lt;span style=&quot;color: #89DCEB;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #F5C2E7;&quot;&gt;pki&lt;/span&gt;&lt;span style=&quot;color: #89DCEB;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #F5C2E7;&quot;&gt;caCertificateBlacklist&lt;/span&gt;&lt;span style=&quot;color: #F38BA8;&quot;&gt; =&lt;/span&gt;&lt;span style=&quot;color: #BAC2DE;&quot;&gt; [&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #BAC2DE;&quot;&gt;  &amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #A6E3A1;&quot;&gt;Comodo AAA Services root&lt;/span&gt;&lt;span style=&quot;color: #BAC2DE;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #BAC2DE;&quot;&gt;  &amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #A6E3A1;&quot;&gt;emSign ECC Root CA - G3&lt;/span&gt;&lt;span style=&quot;color: #BAC2DE;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #BAC2DE;&quot;&gt;]&lt;/span&gt;&lt;span style=&quot;color: #F38BA8;&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Then just rebuild and voila -- you have removed both roots from this machine&#39;s CA bundle.&lt;/p&gt;
&lt;p&gt;These are the roots the affected chains terminated at, not the eight compromised intermediates themselves: removing a root invalidates every chain through it, including chains with nothing to do with this incident.&lt;/p&gt;
&lt;p&gt;The option only adds entries. Whatever you put here is appended to the list nixpkgs ships, so you can drop your own entries later, but not the defaults. Since 2026-10-20 the defaults include all four of the roots involved here -- &lt;code&gt;Comodo AAA Services root&lt;/code&gt;, &lt;code&gt;emSign ECC Root CA - G3&lt;/code&gt;, &lt;code&gt;emSign Root CA - C1&lt;/code&gt; and &lt;code&gt;emSign ECC Root CA - C3&lt;/code&gt; (&lt;a rel=&quot;external&quot; href=&quot;https://github.com/NixOS/nixpkgs/commit/16ac0cd8f4&quot;&gt;commit 16ac0cd8f4&lt;/a&gt;). On a pin newer than that, a plain rebuild is the whole fix and both entries above are duplicates. My hosts were pinned to &lt;code&gt;4533d929&lt;/code&gt; from 2026-02-03, which predates the commit, which is why the manual step was needed.&lt;/p&gt;
&lt;h2 id=&quot;Sources&quot;&gt;Sources&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a rel=&quot;external&quot; href=&quot;https://emudhra.com/en/press-release/emudhra-to-exit-global-ssl-tls-certificate-business&quot;&gt;eMudhra to Exit global SSL/TLS Certificate Business&lt;/a&gt; -- eMudhra press release, 2026-10-22. Voluntary withdrawal; states the affected CAs were revoked within 14 hours, that no end-entity certificates were issued from them, and that no infrastructure was compromised.&lt;/li&gt;
&lt;li&gt;&lt;a rel=&quot;external&quot; href=&quot;https://kudelskisecurity.com/research/emudhra-intermediate-ca-private-key-compromise&quot;&gt;eMudhra Intermediate CA Private Key Compromise&lt;/a&gt; -- Kudelski Security advisory, 2026-10-21. Lists the eight intermediates (six TLS, two code-signing), the Sectigo cross-signs that bring the total to sixteen certificates, and the revocation dates.&lt;/li&gt;
&lt;li&gt;&lt;a rel=&quot;external&quot; href=&quot;https://bugzilla.mozilla.org/show_bug.cgi?id=2083449&quot;&gt;Bug 2083449 -- eMudhra: Private key compromise of Intermediate Certificates&lt;/a&gt; -- Mozilla CA Program record; reported 2026-10-17.&lt;/li&gt;
&lt;li&gt;&lt;a rel=&quot;external&quot; href=&quot;https://hg-edge.mozilla.org/projects/nss/rev/26d38a0c3fb81e7fb2acedbaf4c42dd21dce0517&quot;&gt;NSS rev 26d38a0c3fb8&lt;/a&gt; and &lt;a rel=&quot;external&quot; href=&quot;https://hg-edge.mozilla.org/projects/nss/rev/8159223c48ceeb1273a1915bca95a517294ab0e0&quot;&gt;NSS rev 8159223c48ce&lt;/a&gt; -- the distrusted-root changes NSS shipped.&lt;/li&gt;
&lt;li&gt;&lt;a rel=&quot;external&quot; href=&quot;https://github.com/NixOS/nixpkgs/commit/16ac0cd8f4&quot;&gt;nixpkgs commit 16ac0cd8f4&lt;/a&gt; -- 2026-10-20, &lt;code&gt;nixos/security/pki: distrust various roots with compromised intermediates&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;&lt;a rel=&quot;external&quot; href=&quot;https://pkg.go.dev/vuln/GO-2026-6809&quot;&gt;GO-2026-6809 / CVE-2026-111943&lt;/a&gt; -- Go&#39;s denylist for the eight intermediates; fixed in 1.27.3 and 1.26.10.&lt;/li&gt;
&lt;li&gt;&lt;a rel=&quot;external&quot; href=&quot;https://blog.cloudflare.com/emudhra-patching&quot;&gt;4 real? Tracking exploitation and patching of eMudhra&#39;s weak keys&lt;/a&gt; -- Cloudflare, on attempted exploitation.&lt;/li&gt;
&lt;li&gt;&lt;a rel=&quot;external&quot; href=&quot;https://arstechnica.com/security/2026/10/disgraced-emudhra-drops-out-of-tls-business-following-certificate-debacle&quot;&gt;Disgraced eMudhra drops out of TLS business&lt;/a&gt; -- Ars Technica, 2026-10.&lt;/li&gt;
&lt;/ul&gt;
</content>
        
    </entry>
    <entry xml:lang="en">
        <title>Deploying this site with Nix + Zola</title>
        <published>2026-10-30T00:00:00+00:00</published>
        <updated>2026-10-30T00:00:00+00:00</updated>
        
        <author>
          <name>stuck in vim</name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://stuckinvim.io/posts/deploying-with-nix-zola/"/>
        <id>https://stuckinvim.io/posts/deploying-with-nix-zola/</id>
        
        <content type="html" xml:base="https://stuckinvim.io/posts/deploying-with-nix-zola/">&lt;p&gt;This site is built by Zola inside a Nix derivation and served by Caddy on a Linode VPS.&lt;/p&gt;
&lt;h2 id=&quot;Why_Zola?&quot;&gt;Why Zola?&lt;/h2&gt;
&lt;p&gt;Zola is a single static binary. It needs no runtime dependencies beyond the HTML it produces.&lt;/p&gt;
&lt;h2 id=&quot;How_I_deployed_it&quot;&gt;How I deployed it&lt;/h2&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #CDD6F4; background-color: #181524;&quot; &gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;  { pkgs, ... }:&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;let&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;  site = pkgs.stdenvNoCC.mkDerivation {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    pname = &amp;quot;stuckinvim-site&amp;quot;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    version = &amp;quot;0.1.0&amp;quot;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    src = ../../../sites/stuckinvim;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    nativeBuildInputs = [ pkgs.zola pkgs.cacert ];&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    buildPhase = &amp;#39;&amp;#39;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;      runHook preBuild&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;      cp -r $src/. .&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;      export SSL_CERT_FILE=${pkgs.cacert}/etc/ssl/certs/ca-bundle.crt&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;      zola build&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;      runHook postBuild&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    &amp;#39;&amp;#39;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    installPhase = &amp;#39;&amp;#39;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;      runHook preInstall&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;      mkdir -p $out&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;      cp -r public/. $out/&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;      runHook postInstall&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    &amp;#39;&amp;#39;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;  };&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;in&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;{&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;  services.caddy.virtualHosts = {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    &amp;quot;stuckinvim.io&amp;quot;.extraConfig = &amp;#39;&amp;#39;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;      encode gzip zstd&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;      root * ${site}&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;      file_server&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;      tls acme@rawliyosh.com&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    &amp;#39;&amp;#39;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    &amp;quot;www.stuckinvim.io&amp;quot;.extraConfig = &amp;#39;&amp;#39;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;      redir https://stuckinvim.io{uri} permanent&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    &amp;#39;&amp;#39;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;  };&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;</content>
        
    </entry>
</feed>
