<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>NixOS on Wimpy's World</title><link>https://blog.wimpys.world/tags/nixos/</link><description>Recent content in NixOS on Wimpy's World</description><generator>Hugo -- gohugo.io</generator><language>en-gb</language><managingEditor>martin@wimpress.com (Martin Wimpress)</managingEditor><webMaster>martin@wimpress.com (Martin Wimpress)</webMaster><lastBuildDate>Thu, 15 May 2025 13:37:42 +0100</lastBuildDate><atom:link href="https://blog.wimpys.world/tags/nixos/rss.xml" rel="self" type="application/rss+xml"/><item><title>Nothing but Nix</title><link>https://blog.wimpys.world/posts/nothing-but-nix-github-actions/</link><pubDate>Thu, 15 May 2025 13:37:42 +0100</pubDate><author>martin@wimpress.com (Martin Wimpress)</author><guid>https://wimpysworld.com/posts/nothing-but-nix-github-actions/</guid><description>&lt;p&gt;Have you ever tried to build a complex &lt;a href="https://nixos.org/"&gt;NixOS&lt;/a&gt; ️❄️ configuration in GitHub Actions only to be greeted by the dreaded &lt;em&gt;&amp;ldquo;no space left on device&amp;rdquo;&lt;/em&gt; error? I certainly have, and it&amp;rsquo;s been driving me bonkers for quite some time! 😖&lt;/p&gt;
&lt;p&gt;&lt;a href="https://docs.github.com/en/actions/using-github-hosted-runners/using-github-hosted-runners/about-github-hosted-runners#standard-github-hosted-runners-for-public-repositories"&gt;Standard GitHub Actions runners&lt;/a&gt; come with a paltry ~20GB of free disk space, or so it would seem. Which sounds decent until you try to build sophisticated NixOS or &lt;a href="https://nix-community.github.io/home-manager/"&gt;Home Manager&lt;/a&gt; configurations. A comprehensive workstation or home lab server setup can consume 10-15GB due to all the included packages and dependencies, leaving precious little headroom for anything else 🤏&lt;/p&gt;
&lt;p&gt;This space limitation effectively meant I couldn&amp;rsquo;t build my full workstation and server configurations in CI. So annoying! 😠 I wanted my CI to cache complete builds to &lt;a href="https://flakehub.com/"&gt;FlakeHub Cache&lt;/a&gt;, but was forever stuck with only partial builds or individual packages that wouldn&amp;rsquo;t properly test the complete configurations. This meant that each configuration change on my workstations and servers required frustrating additional compilation time for things like 3rd party kernel modules, &lt;a href="https://ollama.com/"&gt;Ollama&lt;/a&gt;, custom package overrides, and more - all because I couldn&amp;rsquo;t get full builds cached through CI ️🥺&lt;/p&gt;
&lt;p&gt;Well, I&amp;rsquo;d had enough of that nonsense and decided to solve the problem once and for all 🧠&lt;/p&gt;
&lt;h2 id="introducing-nothing-but-nix-"&gt;Introducing &lt;em&gt;Nothing but Nix&lt;/em&gt; ️❄️&lt;/h2&gt;
&lt;p&gt;I&amp;rsquo;m chuffed to bits to announce &lt;a href="https://github.com/marketplace/actions/nothing-but-nix"&gt;&lt;em&gt;Nothing but Nix&lt;/em&gt;&lt;/a&gt;, a GitHub Action that &lt;strong&gt;brutally reclaims&lt;/strong&gt; disk space 🪓 on runners and transforms them into Nix powerhouses!&lt;/p&gt;
&lt;p&gt;Here&amp;rsquo;s what it does in a nutshell:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-yaml" data-lang="yaml"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;- &lt;span class="nt"&gt;uses&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="l"&gt;actions/checkout@v4&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;- &lt;span class="nt"&gt;uses&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="l"&gt;wimpysworld/nothing-but-nix@main&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;- &lt;span class="nt"&gt;uses&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="l"&gt;DeterminateSystems/determinate-nix-action@main&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;- &lt;span class="nt"&gt;run&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;|&lt;/span&gt;&lt;span class="sd"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="sd"&gt; nix flake check&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;The result? Instead of ~20GB for your &lt;a href="https://zero-to-nix.com/concepts/nix-store/"&gt;Nix store&lt;/a&gt;, you get &lt;strong&gt;65GB to 130GB&lt;/strong&gt; of sweet, glorious Nix-dedicated space. That&amp;rsquo;s enough to build even the chonkiest of configurations! 🪨&lt;/p&gt;
&lt;h2 id="space-the-final-frontier-"&gt;Space, the Final Frontier 🌌&lt;/h2&gt;
&lt;p&gt;Working at &lt;a href="https://determinate.systems"&gt;Determinate Systems&lt;/a&gt;, I get to see firsthand how powerful Nix can be when properly cached. Our &lt;a href="https://flakehub.com"&gt;FlakeHub Cache&lt;/a&gt; makes system updates lightning fast ⚡ but I couldn&amp;rsquo;t fully leverage it in CI because my builds kept running out of space.&lt;/p&gt;
&lt;p&gt;I wanted to be able to &lt;strong&gt;build and test all my configurations&lt;/strong&gt; in CI:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;💁 &lt;strong&gt;Servers:&lt;/strong&gt; media services, local LLMs, website, fediverse services, distributed storage, backup&lt;/li&gt;
&lt;li&gt;️🖥️ &lt;strong&gt;Workstations:&lt;/strong&gt; dual GPU, loaded with dev tools, content creation apps and local LLMs&lt;/li&gt;
&lt;li&gt;💻 &lt;strong&gt;Laptops:&lt;/strong&gt; optimized for travel, media on the go, presentations and development&lt;/li&gt;
&lt;li&gt;👻 &lt;strong&gt;VMs:&lt;/strong&gt; for &lt;a href="https://ubuntu-mate.org"&gt;Linux desktop development&lt;/a&gt; and testing&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;But GitHub&amp;rsquo;s ~20GB limitation kept getting in the way 🙅 Sure, I could have paid GitHub for their larger runners with more disk space, but being both cheap and stubborn, I wasn&amp;rsquo;t having any of that! 💸❌ Instead, I started thinking, &lt;em&gt;&amp;ldquo;Hang on a minute, those free runners must have more space somewhere - I just need to find it and claim it!&amp;rdquo;&lt;/em&gt; 🤔💭&lt;/p&gt;
&lt;p&gt;After digging through the runner specs and file system layout, I discovered that &lt;strong&gt;GitHub Actions runners have a large chunk of free space on the &lt;code&gt;/mnt&lt;/code&gt; filesystem that&amp;rsquo;s barely used&lt;/strong&gt; 🤯 There was also the possibility to reclaim significant space by purging pre-installed software that Nix users don&amp;rsquo;t need anyway 😈&lt;/p&gt;
&lt;h2 id="the-slightly-mad-science-bit-"&gt;The Slightly Mad Science Bit ‍🧑‍🔬&lt;/h2&gt;
&lt;p&gt;At its core, &lt;em&gt;Nothing but Nix&lt;/em&gt; uses a two-pronged attack:&lt;/p&gt;
&lt;h3 id="1-the-initial-slash-instant-volume-creation"&gt;1. The Initial Slash: Instant Volume Creation&lt;/h3&gt;
&lt;p&gt;First, the action creates a large loop device from free space on &lt;code&gt;/mnt&lt;/code&gt; and sets up a properly tuned BTRFS filesystem:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;# Create a large disk image in the free space&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nv"&gt;free_space&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="k"&gt;$(&lt;/span&gt;df -m --output&lt;span class="o"&gt;=&lt;/span&gt;avail /mnt &lt;span class="p"&gt;|&lt;/span&gt; tail -n &lt;span class="m"&gt;1&lt;/span&gt; &lt;span class="p"&gt;|&lt;/span&gt; tr -d &lt;span class="s1"&gt;&amp;#39; &amp;#39;&lt;/span&gt;&lt;span class="k"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nv"&gt;loop_dev&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="k"&gt;$(&lt;/span&gt;sudo losetup --find&lt;span class="k"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;sudo fallocate -l &lt;span class="k"&gt;$((&lt;/span&gt;free_space &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="m"&gt;1024&lt;/span&gt;&lt;span class="k"&gt;))&lt;/span&gt;M &lt;span class="s2"&gt;&amp;#34;/mnt/disk0.img&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;sudo losetup &lt;span class="s2"&gt;&amp;#34;&lt;/span&gt;&lt;span class="si"&gt;${&lt;/span&gt;&lt;span class="nv"&gt;loop_dev&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;/mnt/disk0.img&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;# Set up an optimized BTRFS filesystem&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;sudo mkfs.btrfs -L nix -d raid0 -m raid0 --nodiscard &lt;span class="s2"&gt;&amp;#34;&lt;/span&gt;&lt;span class="si"&gt;${&lt;/span&gt;&lt;span class="nv"&gt;loop_dev&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;sudo mount &lt;span class="nv"&gt;LABEL&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;nix /nix -o noatime,nobarrier,nodiscard,compress&lt;span class="o"&gt;=&lt;/span&gt;zstd:1,space_cache&lt;span class="o"&gt;=&lt;/span&gt;v2,commit&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="m"&gt;120&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&lt;strong&gt;This immediately provides around 65GB of Nix-ready space before your workflow even gets going!&lt;/strong&gt; 💪
I could have stopped here, but did I mention beging stubborn yet? 🫏&lt;/p&gt;
&lt;h3 id="2-the-background-purge-merciless-space-reclamation"&gt;2. The Background Purge: Merciless Space Reclamation&lt;/h3&gt;
&lt;p&gt;&lt;strong&gt;While your workflow continues&lt;/strong&gt;, &lt;em&gt;Nothing but Nix&lt;/em&gt; starts a background process to ruthlessly eliminate unnecessary software:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Docker images? Gone! 🗑️&lt;/li&gt;
&lt;li&gt;Language runtimes? Obliterated! 💥&lt;/li&gt;
&lt;li&gt;Package managers? Annihilated! 💣&lt;/li&gt;
&lt;li&gt;Documentation? Vaporized! 🔥&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;As space is reclaimed, it creates a second disk image on the root file system and adds it to the BTRFS pool, &lt;strong&gt;dynamically growing your Nix volume up to around 130GB.&lt;/strong&gt; 🚀&lt;/p&gt;
&lt;p&gt;The file system purge is powered by &lt;code&gt;rmz&lt;/code&gt; (from the &lt;a href="https://github.com/SUPERCILEX/fuc"&gt;Fast Unix Commands (FUC)&lt;/a&gt; project) - a high-performance alternative to &lt;code&gt;rm&lt;/code&gt; that makes deletion blazingly fast. &lt;strong&gt;Using traditional &lt;code&gt;rm&lt;/code&gt; a full file system purge took ~11 minutes ⏳😞 &lt;code&gt;rmz&lt;/code&gt; cut that to under 60 seconds!&lt;/strong&gt; ️⏱️😀&lt;/p&gt;
&lt;h3 id="btrfs-with-nodiscard"&gt;BTRFS with &lt;code&gt;nodiscard&lt;/code&gt;?&lt;/h3&gt;
&lt;p&gt;I&amp;rsquo;m using &lt;a href="https://btrfs.readthedocs.io/en/latest/"&gt;BTRFS&lt;/a&gt; for the volume because it:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Supports dynamic device addition&lt;/li&gt;
&lt;li&gt;Has built-in compression to save even more space&lt;/li&gt;
&lt;li&gt;Allows optimal space utilization with RAID0 layout&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;The &lt;strong&gt;&lt;code&gt;nodiscard&lt;/code&gt; mount option is absolutely essential&lt;/strong&gt; because we&amp;rsquo;re using loop devices backed by &lt;a href="https://en.wikipedia.org/wiki/Sparse_file"&gt;sparse files&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Without it, BTRFS would try to issue &lt;a href="https://btrfs.readthedocs.io/en/latest/Trim.html"&gt;TRIM/discard&lt;/a&gt; commands that cause allocation size to be misreported when using loop devices. This misreporting would result in inaccurate space accounting. The &lt;code&gt;nodiscard&lt;/code&gt; option ensures the filesystem maintains an accurate picture of its available storage.&lt;/p&gt;
&lt;h2 id="choose-your-weapon-the-hatchet-protocol-"&gt;Choose Your Weapon: The Hatchet Protocol 🪓&lt;/h2&gt;
&lt;p&gt;Not everyone needs the same level of space reclamation, so I&amp;rsquo;ve added different &lt;em&gt;&amp;ldquo;Hatchet Protocol&amp;rdquo;&lt;/em&gt; levels to control how aggressive the action is:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-yaml" data-lang="yaml"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;- &lt;span class="nt"&gt;uses&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="l"&gt;wimpysworld/nothing-but-nix@main&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nt"&gt;with&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nt"&gt;hatchet-protocol&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;cleave&amp;#39;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="c"&gt;# Options: holster, carve, cleave (default), rampage&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Protocol&lt;/th&gt;
&lt;th&gt;&lt;code&gt;/nix&lt;/code&gt;&lt;/th&gt;
&lt;th&gt;Description&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Holster&lt;/td&gt;
&lt;td&gt;~65GB&lt;/td&gt;
&lt;td&gt;Keep the hatchet sheathed, use space from &lt;code&gt;/mnt&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Carve&lt;/td&gt;
&lt;td&gt;~85GB&lt;/td&gt;
&lt;td&gt;Craft and combine free space from &lt;code&gt;/&lt;/code&gt; and &lt;code&gt;/mnt&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Cleave&lt;/td&gt;
&lt;td&gt;~115GB&lt;/td&gt;
&lt;td&gt;Make decisive cuts to large packages&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Rampage&lt;/td&gt;
&lt;td&gt;~130GB&lt;/td&gt;
&lt;td&gt;Relentless elimination of all bloat&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;I recommend &lt;strong&gt;Cleave&lt;/strong&gt; for most users, which is the default setting. It strikes a good balance between reclaiming space and keeping some useful tools around. But if you&amp;rsquo;re a proper Nix enthusiast who believes that &lt;code&gt;#nix-is-life&lt;/code&gt;, the Rampage protocol will squeeze out every last byte of space for your Nix store ️️❄️&lt;/p&gt;
&lt;h2 id="from-frustration-to-freedom-"&gt;From Frustration to Freedom ️🕊️&lt;/h2&gt;
&lt;p&gt;Since implementing &lt;em&gt;Nothing but Nix&lt;/em&gt;, I&amp;rsquo;ve been able to build &lt;strong&gt;all&lt;/strong&gt; my NixOS and Home Manager configurations in CI. This means:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;🔒 Every &lt;code&gt;flake.lock&lt;/code&gt; update is fully tested against my complete configuration set&lt;/li&gt;
&lt;li&gt;✅ All successful builds are cached to FlakeHub Cache&lt;/li&gt;
&lt;li&gt;⚡ System updates are lightning-fast&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;This has been an absolute game-changer for my workflow. Now when I apply updates to any of my devices, everything is delivered directly from &lt;code&gt;cache.flakehub.com&lt;/code&gt; with zero local compilation time! 🚀 All packages have been pre-built and verified in CI, meaning updates that would have taken ages to compile (&lt;em&gt;looking at you &lt;code&gt;ollama&lt;/code&gt;&lt;/em&gt; 👀) locally now complete in seconds. It&amp;rsquo;s the difference between waiting for a coffee break and a blink-and-you&amp;rsquo;ll-miss-it experience 🤩&lt;/p&gt;
&lt;p&gt;Here&amp;rsquo;s what the build times look like:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;💁 2x Servers: ~5-10 minutes&lt;/li&gt;
&lt;li&gt;️🖥️ 2x Workstations: ~6-13 minutes&lt;/li&gt;
&lt;li&gt;💻 4x Laptops: ~7-10 minutes&lt;/li&gt;
&lt;li&gt;👻 2x Virutal Manachines: ~4-10 minutes&lt;/li&gt;
&lt;li&gt;📦 59x Local packages: ~5-14 minutes&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id="getting-started-with-nothing-but-nix-"&gt;Getting Started with &lt;em&gt;Nothing but Nix&lt;/em&gt; ✨&lt;/h2&gt;
&lt;p&gt;Ready to give it a go? Here&amp;rsquo;s how to use it in your GitHub Actions workflow:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-yaml" data-lang="yaml"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nt"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;Test Nix Flake&amp;#34;&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nt"&gt;on&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nt"&gt;pull_request&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nt"&gt;push&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nt"&gt;branches&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="l"&gt;main ]&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nt"&gt;jobs&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nt"&gt;tests&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nt"&gt;runs-on&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="l"&gt;ubuntu-latest&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nt"&gt;permissions&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nt"&gt;id-token&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="l"&gt;write&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nt"&gt;contents&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="l"&gt;read&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nt"&gt;steps&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;- &lt;span class="nt"&gt;uses&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="l"&gt;actions/checkout@v4 &lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="c"&gt;# 👇 Add this before installing Nix&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;- &lt;span class="nt"&gt;uses&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="l"&gt;wimpysworld/nothing-but-nix@main &lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;- &lt;span class="nt"&gt;uses&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="l"&gt;DeterminateSystems/determinate-nix-action@main&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;- &lt;span class="nt"&gt;run&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;|&lt;/span&gt;&lt;span class="sd"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="sd"&gt; # Now you have 100+ GB for your Nix builds!
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="sd"&gt; nix build . -L
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="sd"&gt; nix flake check&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;For FlakeHub users, make sure you add the &lt;code&gt;permissions&lt;/code&gt; block as shown above. This allows &lt;a href="https://determinate.systems/nix/"&gt;Determinate Nix&lt;/a&gt; to authenticate with FlakeHub and FlakeHub Cache.&lt;/p&gt;
&lt;h2 id="beyond-storage-to-virtual-machines-"&gt;Beyond Storage to Virtual Machines? 🔮&lt;/h2&gt;
&lt;p&gt;Now that I&amp;rsquo;ve proven large volumes can be dynamically constructed in GitHub runners, I&amp;rsquo;m starting to think about what else might be possible. A GitHub action that implements something like &lt;a href="https://github.com/quickemu-project/quickemu"&gt;Quickemu&lt;/a&gt; (&lt;em&gt;another project of mine&lt;/em&gt;), to standup KVM-accelerated VMs inside a GitHub runner is my favourite idea 💡&lt;/p&gt;
&lt;p&gt;GitHub has &lt;a href="https://github.blog/changelog/2023-02-23-hardware-accelerated-android-virtualization-on-actions-windows-and-linux-larger-host"&gt;recently announced&lt;/a&gt; hardware acceleration for Android virtualization on Linux runners, which means the KVM infrastructure is already there and avilable for open source projects and larger runners 😯 All we need to do is leverage it for our own VMs.&lt;/p&gt;
&lt;p&gt;Imagine being able to run a full VM of your validated build environment inside GitHub Actions! It would be like having a self-hosted runner, but without the self-hosting 😏 And it just so happens that the &lt;a href="https://github.com/DeterminateSystems/determinate-nix-action"&gt;Determinate Nix Action&lt;/a&gt; enables KVM in GitHub runners. Coincidence? 😉&lt;/p&gt;
&lt;h2 id="build-something-massive-"&gt;Build Something Massive ️🏗️&lt;/h2&gt;
&lt;p&gt;&lt;em&gt;Nothing but Nix&lt;/em&gt; removes one of the most frustrating limitations for Nix users in GitHub Actions. No more trimming your configurations to fit into tiny spaces - now you can build and test your full NixOS fleet with confidence 🤓&lt;/p&gt;
&lt;p&gt;Give it a try, and let me know what you think!&lt;/p&gt;
&lt;p&gt;The action is available at:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;GitHub: &lt;a href="https://github.com/wimpysworld/nothing-but-nix"&gt;wimpysworld/nothing-but-nix&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Marketplace: &lt;a href="https://github.com/marketplace/actions/nothing-but-nix"&gt;&lt;em&gt;Nothing but Nix&lt;/em&gt;&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;If you run into any issues or have ideas for improvements, please open an issue on GitHub. And if this tool saves your CI builds, consider giving the repo a star! ⭐&lt;/p&gt;
&lt;p&gt;Happy Nixing! ❄️&lt;/p&gt;</description><summary>The Nix Space Heist: Reclaiming 130GB in GitHub Actions</summary></item><item><title>Why I chose the ThinkPad Z13 Gen1 as my Linux laptop</title><link>https://blog.wimpys.world/posts/why-i-chose-the-thinkpad-z13-as-my-linux-laptop/</link><pubDate>Tue, 18 Apr 2023 14:30:26 +0000</pubDate><author>martin@wimpress.com (Martin Wimpress)</author><guid>https://wimpysworld.com/posts/why-i-chose-the-thinkpad-z13-as-my-linux-laptop/</guid><description>&lt;p&gt;During the second half of 2022, I dusted off my laptop and travelled to three events for the first time in over two years. During these trips, it became apparent that my laptop is not the right tool for the job.&lt;/p&gt;
&lt;p&gt;At &lt;a href="https://events.linuxfoundation.org/archive/2022/kubecon-cloudnativecon-europe/"&gt;KubeCon EU 2022&lt;/a&gt; my colleague Lindsay brought her &lt;a href="https://www.apple.com/uk/macbook-pro-13/"&gt;Apple Macbook Pro M1&lt;/a&gt;. It was lightweight, compact, looked fabulous and had epic battery life. Meanwhile, my ThinkPad P1 Gen 1 looked fabulous but it is a bit of a chonker and a massive power pig 🔌🐖 Battery anxiety was constant that week and also on my subsequent trips to &lt;a href="https://www.sreday.com/"&gt;SREday 2022&lt;/a&gt; and the &lt;a href="https://events.canonical.com/event/2/"&gt;Ubuntu Summit 2022&lt;/a&gt;. Sensing that 2022 wasn&amp;rsquo;t an outlier and more travel would be on the cards in 2023 I decided that I wanted some of that thin and light laptop action. In early December 2022, I went hunting for a Linux laptop and this is my journey.&lt;/p&gt;
&lt;h2 id="as-featured-on-linux-matters-"&gt;As featured on Linux Matters! 🎙️&lt;/h2&gt;
&lt;p&gt;I recently discussed my hunt for a new Linux Loving Laptop on the &lt;a href="https://linuxmatters.sh/"&gt;Linux Matters&lt;/a&gt; podcast. &lt;strong&gt;You can hear that discussion with my friends Alan and Mark in &lt;a href="https://linuxmatters.sh/1/"&gt;Linux Matters: Mastodon on My Résumé (Episode 1)&lt;/a&gt;&lt;/strong&gt;.&lt;/p&gt;
&lt;p class="text-center"&gt;
&lt;a href="https://linuxmatters.sh" target="_blank"&gt;&lt;img src="https://linuxmatters.sh/img/episode/linuxmatters-banner-3000x750.webp" class="img-fluid" alt="Linux Matters Podcast"/&gt;&lt;/a&gt;
&lt;br /&gt;
&lt;em&gt;Linux Matters Podcast&lt;/em&gt;
&lt;/p&gt;
&lt;h2 id="past-laptop-purchasing-mistakes-"&gt;Past laptop purchasing mistakes 😱&lt;/h2&gt;
&lt;blockquote&gt;
&lt;p&gt;&amp;ldquo;Those that fail to learn from history are doomed to repeat it&amp;rdquo; - Winston Churchill.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;The requirements for my last two laptop purchases were very different from what I need today; a &lt;a href="https://www.dell.com/en-uk/shop/laptop-computers-2-in-1-pcs/precision-5550-mobile-workstation/spd/precision-15-5550-laptop"&gt;Dell XPS 15 5550&lt;/a&gt; and &lt;a href="https://www.lenovo.com/gb/en/p/laptops/thinkpad/thinkpadp/thinkpad-p1/22ws2wpp101"&gt;ThinkPad P1 Gen1&lt;/a&gt; Both have significant power requirements with 15.6&amp;quot; UHD displays and discrete NVIDIA GPUs. The ThinkPad P1 Gen also sports a Xeon CPU ⚡️ These made sense when I bought them, I was travelling one week every month and regularly compiling large applications, building container images, VMs and operating system images. These days I have a &lt;a href="https://www.amd.com/en/products/cpu/amd-ryzen-threadripper-3970x"&gt;Threadripper 3970X&lt;/a&gt; workstation at home that I can connect to via &lt;a href="https://tailscale.com/"&gt;Tailscale&lt;/a&gt; to run compute-intensive tasks. I simply don&amp;rsquo;t need a workhorse 🐴 laptop anymore.&lt;/p&gt;
&lt;h3 id="laptop-criteria-"&gt;Laptop criteria 📑&lt;/h3&gt;
&lt;p&gt;I&amp;rsquo;m deeply impressed with the outstanding work the &lt;a href="https://asahilinux.org/"&gt;Asahi Linux&lt;/a&gt; team are doing to enable Linux on Apple Silicon Macs, but running Linux on an M1 Mac isn&amp;rsquo;t viable for me as some hardware support (HDMI for example) is still a work in progress at the time of writing. Not ideal when you&amp;rsquo;re a conference speaker and running booth demos.&lt;/p&gt;
&lt;p&gt;These are my criteria for the new laptop. Some must-haves, some nice-to-haves and some hard exclusions.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Fully Linux compatible.
&lt;ul&gt;
&lt;li&gt;Linux pre-installed to demonstrate Linux is fully supported&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Full working day battery life; ~8 hours in my opinion.&lt;/li&gt;
&lt;li&gt;Low-power CPU, 35W or under
&lt;ul&gt;
&lt;li&gt;Ideally AMD 6000 series but a 12th Gen Intel as a compromise&lt;/li&gt;
&lt;li&gt;No 11th Gen Intel or AMD 5000 series CPUs will be considered&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;64GB RAM, will compromise on 32GB RAM&lt;/li&gt;
&lt;li&gt;13&amp;quot; or 14&amp;quot; 1920x1200 matte display
&lt;ul&gt;
&lt;li&gt;No UHD resolutions display will be considered (for power-saving reasons)&lt;/li&gt;
&lt;li&gt;Touch support is a nice-to-have, but not essential&lt;/li&gt;
&lt;li&gt;1920x1080 as a compromise, but nothing lower&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;No discrete GPU. Again for power-saving reasons.&lt;/li&gt;
&lt;li&gt;USB-C charging&lt;/li&gt;
&lt;li&gt;Dual NVME SSD, or at least a single 2TB (or more) SSD&lt;/li&gt;
&lt;li&gt;Decent keyboard and touchpad&lt;/li&gt;
&lt;li&gt;The Laptop should weigh close to 1kg&lt;/li&gt;
&lt;li&gt;Premium build quality and design (somewhat subjective I know)&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;With this list of requirements established, I &lt;a href="https://docs.google.com/spreadsheets/d/1kaB1pxbbYa1ebxeDRTguQ9EZol1EhM-0FE45Da8AOn8/edit#gid=0"&gt;started collating Linux laptop comparison notes in this somewhat idiosyncratic spreadsheet&lt;/a&gt;&lt;/p&gt;
&lt;p class="text-center"&gt;
&lt;a href="https://docs.google.com/spreadsheets/d/1kaB1pxbbYa1ebxeDRTguQ9EZol1EhM-0FE45Da8AOn8/edit#gid=0" target="_blank"&gt;&lt;img src="./spreadsheet.webp" class="img-fluid" alt="Linux Laptop Comparison Spreadsheet"/&gt;&lt;/a&gt;
&lt;br /&gt;
&lt;em&gt;A spreadsheet that probably only makes sense to me&lt;/em&gt;
&lt;/p&gt;
&lt;p&gt;Looking at the list of laptops in the sheet above, you might be wondering why I didn&amp;rsquo;t consider any laptops from the established dedicated Linux laptop vendors such as &lt;a href="https://www.entroware.com/store/"&gt;Entroware&lt;/a&gt;, &lt;a href="https://slimbook.es/"&gt;Slimbook&lt;/a&gt; and &lt;a href="https://starlabs.systems/"&gt;StarLabs&lt;/a&gt;. Well, I did look at everything they offered at the time and none of them had a model available that met the requirements I&amp;rsquo;ve outlined above or the estimated dispatch time was nearly half a year.&lt;/p&gt;
&lt;p&gt;I&amp;rsquo;m not going to elaborate on the rationale behind ruling certain laptop models in or out, but I will say this; I was very impressed to see &lt;a href="http://lenovo.com/linux"&gt;&lt;strong&gt;every laptop in the Lenovo ThinkPad lineup had a Linux pre-install option&lt;/strong&gt;&lt;/a&gt; of either &lt;a href="https://ubuntu.com"&gt;Ubuntu&lt;/a&gt; or &lt;a href="https://getfedora.org/"&gt;Fedora&lt;/a&gt; in &amp;ldquo;Build YourPC&amp;rdquo; system configurator. While comparing the power requirements of Intel&amp;rsquo;s i7-12xx series and AMD&amp;rsquo;s 68x0 series CPU at the time, I was sold on the impressive battery endurance of AMD&amp;rsquo;s offerings and the superior integrated graphics, so I excluded any laptop with Intel CPUs quite early on.&lt;/p&gt;
&lt;h2 id="lenovo-thinkpad-z13-gen-1-with-ubuntu-pre-installed"&gt;Lenovo ThinkPad Z13 Gen 1 with Ubuntu pre-installed&lt;/h2&gt;
&lt;p&gt;I went with the &lt;a href="https://www.lenovo.com/gb/en/p/laptops/thinkpad/thinkpadz/thinkpad-z13-(13-inch-amd)/21d2cto1wwgb1"&gt;ThinkPad Z13 Gen 1&lt;/a&gt; with Ubuntu pre-installed, and the &lt;a href="https://www.lenovo.com/gb/en/p/laptops/thinkpad/thinkpadt/thinkpad-t14s-gen-3-(14-inch-amd)/len101t0015"&gt;ThinkPad T14s Gen 3&lt;/a&gt; was runner-up in my selection process.&lt;/p&gt;
&lt;h3 id="specifications-"&gt;Specifications 📝&lt;/h3&gt;
&lt;p&gt;The key specifications for the laptop I ordered are AMD Ryzen 7 PRO 6850U CPU, 32 GB LPDDR5-6400MHz (Soldered), 1 TB SSD M.2 2242 PCIe Gen4, 13.3&amp;quot; WUXGA (1920 x 1200), IPS, Anti-Glare, Non-Touch display weighing in at 1.19kg. I think this configuration hits the sweet spot for battery endurance, more on that later.&lt;/p&gt;
&lt;p&gt;I&amp;rsquo;m not a fan of the increasing trend of soldering RAM on motherboards, but that was common across all the models of laptops I was considering. If &lt;a href="https://frame.work/gb/en"&gt;Framework&lt;/a&gt; had offered an AMD 6000 series CPU option at the time, I would&amp;rsquo;ve had a Framework laptop on my short list as the modular design of the Framework laptops is very appealing.&lt;/p&gt;
&lt;p&gt;And yes, I did make a compromise with the laptop specifications; that 1TB M.2 SSD is below my minimum requirement of 2TB. I did do my homework though and will present my creative upgrade solution in a future blog post. &lt;a href="https://blog.wimpys.world/posts/rss.xml"&gt;Like and Subscribe&lt;/a&gt; 😉&lt;/p&gt;
&lt;h3 id="build-quality--design-"&gt;Build Quality &amp;amp; Design 💻️&lt;/h3&gt;
&lt;p&gt;Without a doubt, the ThinkPad Z13 Gen 1 is a gorgeous laptop. I do not have enough superlatives to express just how much I love it. It is, in my option, an almost flawless design. Exactly the compact form factor laptop I was seeking; it&amp;rsquo;s beautiful to look at from any angle and a delight to use. Here are some highlights.&lt;/p&gt;
&lt;p class="text-center"&gt;
&lt;img src="./ThinkPad_Z13_Gen_1_CT1_02.webp" class="img-fluid" alt="ThinkPad Z13 Gen 1"/&gt;
&lt;br /&gt;
&lt;em&gt;ThinkPad Z13 Gen 1&lt;/em&gt;
&lt;/p&gt;
&lt;p&gt;The laptop is engineered from 75% recycled aluminium and 95% recycled plastics, then boxed in 100% renewable, compostable packaging. The touchpad is sublime and amazingly 120mm wide on the compact laptop. The haptic touch is simply excellent. The touchpad is the most Macbook-like touchpad I&amp;rsquo;ve used on any PC and it is so good it has caused me to change what desktop environment I now use. More on this in a future blog post. However, there is currently no Linux software to &lt;a href="https://psref.lenovo.com/syspool/Sys/PDF/datasheet/ThinkPad_Z_Series_Haptic_TouchPad_Settings.pdf"&gt;configure the haptic touchpad settings&lt;/a&gt; such as click force and touchpad feedback intensity but I&amp;rsquo;ve been perfectly happy with the defaults. If you do dual boot Windows the haptic settings configured via Windows are stored on the device and carry over to Linux.&lt;/p&gt;
&lt;p&gt;The Keyboard is an excellent low-profile design, each key has ~1.2mm of travel which is the same as the actuation point on my Razer Huntsman V2 TKL keyboards with opto-mechanical switches. Most importantly the Fn&lt;/kbd&gt; key is in the correct place on the Z13 and not where ThinkPads have been incorrectly plonking it for years. Fight me! 🥊 If you are a long-time ThinkPad owner, it is likely you&amp;rsquo;ll hate the idea of the keyboard and touchpad on the Z13 since it is quite a departure from the traditional design. But I went into this with my eyes 👀 open and have watched and read many reviews.&lt;/p&gt;
&lt;p class="text-center"&gt;
&lt;img src="./ThinkPad_Z13_Gen_1_CT4_01.webp" class="img-fluid" alt="Correct Fn key placement on ThinkPad Z13 Gen 1"/&gt;
&lt;br /&gt;
&lt;em&gt;"This is the way"&lt;/em&gt;
&lt;/p&gt;
&lt;p&gt;The Display is bright (400nits), anti-reflective and anti-smudge, covers 100% of the sRGB colour gamut and the laptop is perfectly balanced so it can be opened one-handed. I&amp;rsquo;m embracing the compact, thin and light lifestyle; so the two USB-C ports are fine with me as I&amp;rsquo;ve chosen a laptop configuration with excellent battery endurance (more on that in a bit) and plan to use it completely untethered most of the time with cables and adapters only plugged in for very specific tasks and overnight recharging.&lt;/p&gt;
&lt;p&gt;I do have one niggle though; there is an unusable 2242 M.2 slot on the motherboard. It is only intended for use with select models of WWAN cards, none of which are a configuration option for the UK models of the Z13. It doesn&amp;rsquo;t look like the antenna is wired in either, so even if you do get a supported WWAN card aftermarket it is unlikely to work well; if at all. I can share my iPhone&amp;rsquo;s mobile service via Wifi, so not a deal breaker in that regard but it is rather annoying to have an M.2 slot on the motherboard and nothing I can do with it.&lt;/p&gt;
&lt;h3 id="ubuntu-pre-install-experience-"&gt;Ubuntu pre-install experience 👌&lt;/h3&gt;
&lt;p&gt;It is worth noting that at the time of purchase, selecting Ubuntu or Fedora in the system configuration on the Lenovo website applied a £155 discount! 🤑 Choosing Ubuntu or Fedora across the ThinkPad line applies a discount, although the amount varies based on the model.&lt;/p&gt;
&lt;p&gt;All OEMs that partner with Ubuntu get an OEM designation for each device officially endorsed and supported by Canonical. The ThinkPad Z13 Gen 1 is known as &lt;em&gt;Sutton Newell Abe&lt;/em&gt; and the &lt;code&gt;oem-sutton.newell-abe-meta&lt;/code&gt; package (along with the associated OEM PPA) provides the device-specific hardware enablement and power management tuning.&lt;/p&gt;
&lt;p class="text-center"&gt;
&lt;img src="./oem-name.webp" class="img-fluid" alt="ThinkPad Z13 Gen 1 (Sutton Newell Abe)"/&gt;
&lt;br /&gt;
&lt;em&gt;ThinkPad Z13 Gen 1 is known as Sutton Newell Abe for OEM enablement&lt;/em&gt;
&lt;/p&gt;
&lt;p&gt;The OEM image of Ubuntu differs from the standard Ubuntu image in a few ways. The most obvious is that OEM image comes with recovery media creation pre-installed. This is a great feature and I highly recommend you use it to create a recovery USB stick, either during the initial setup or post-setup. The OEM image also comes with Chromium and Firefox installed, as opposed to just Firefox in the downloadable release of Ubuntu. IIRC, this is because Chromium has traditionally worked better with touchscreen laptops. The fingerprint reader works. I was able to enrol fingerprints quickly and authenticate GDM logins. But the biometric support does not extend throughout the system; Ubuntu Software doesn&amp;rsquo;t integrate with the fingerprint reader, nor does &lt;code&gt;snapd&lt;/code&gt; or any other privilege escalation.&lt;/p&gt;
&lt;p&gt;I also experienced the touchpad becoming unresponsive, requiring a click to &amp;ldquo;unfreeze&amp;rdquo; it. This happens quite frequently and detracts from what is otherwise an excellent, class-leading, touchpad. I suspect it is overly aggressive power management settings in the OEM image, but I didn&amp;rsquo;t investigate beyond that hunch. Both these issues with the fingerprint reader and touchpad are Ubuntu-specific and nothing related to the actual hardware. Both issues are absent when running NixOS.&lt;/p&gt;
&lt;p&gt;Having a tier-1 vendor such as Lenovo ship a laptop with Ubuntu pre-installed has the benefit of great firmware support. I&amp;rsquo;ve received several firmware updates since I got the laptop, and they have all applied without issue.&lt;/p&gt;
&lt;p class="text-center"&gt;
&lt;img src="./firmware-update.webp" class="img-fluid" alt="ThinkPad Z13 Gen 1 firmware updates on Ubuntu"/&gt;
&lt;br /&gt;
&lt;em&gt;Firmware updates for the ThinkPad Z13 Gen 1 on Ubuntu 20.04&lt;/em&gt;
&lt;/p&gt;
&lt;h4 id="why-not-ubuntu-2204-"&gt;Why not Ubuntu 22.04? 🤔&lt;/h4&gt;
&lt;p&gt;My Z13 was shipped with Ubuntu 20.04.4 with OEM optimised Linux kernel 5.14.0-1054-oem. Some might be perplexed (or annoyed) that it didn&amp;rsquo;t come with Ubuntu 22.04, given it was ordered in late 2022. I used to work for Canonical, and during that time worked with Lenovo to enable Ubuntu on ~60 of their laptops and workstations between 2019 and 2021, so I do have some insight into how this process works. It simply boils down to how the factory image certification process works, and once an image is qualified that is what ships on the device for the duration of its availability. Re-certification adds cost and takes time, so it&amp;rsquo;s extremely rare for a device to have a revised factory image qualified once it has gone on sale.&lt;/p&gt;
&lt;p&gt;Upgrading to Ubuntu 22.04 LTS worked flawlessly, full audio support was restored and no other hardware supported regressed. Brilliant.&lt;/p&gt;
&lt;h4 id="linux-kernel-61-"&gt;Linux Kernel 6.1 🌰&lt;/h4&gt;
&lt;p&gt;The pre-installed Ubuntu and Fedora images for the Z13 come with kernels that have backported patches applied to fully support the device. If you buy a ThinkPad Z13 and plan to run another Linux distro on it, make sure you can install Linux kernel version 6.1 or newer. This is to ensure the Qualcomm Wi-Fi 6E NFA725A 2x2 AX chipset is fully supported and that the required patches to properly suspend and resume are available.&lt;/p&gt;
&lt;h3 id="battery-endurance-"&gt;Battery endurance 🔋&lt;/h3&gt;
&lt;p&gt;This is, after all, my most important selection criteria. The conclusion here is simple: &lt;strong&gt;11 hours&lt;/strong&gt; ⏱️&lt;/p&gt;
&lt;p&gt;This is 11 hours of mixed-use. Coding in Visual Studio Code. Chatting in Slack and Discord. Video calls in Google Meet and Zoom. Compiling software. Some screen capture with OBS Studio and basic video editing with &lt;a href="https://shotcut.org/"&gt;Shotcut&lt;/a&gt;. Closing the lid of the laptop and leaving it suspended for 24 hours depletes the battery by ~4% which is about 2 Wh. Very respectable. I haven&amp;rsquo;t felt the need to profile power consumption or tweak anything as I&amp;rsquo;m get plenty of untethered compute time. I&amp;rsquo;m very happy with the battery life, typically charging the laptop overnight while I sleep and running it all day battery only.&lt;/p&gt;
&lt;h2 id="whats-next-"&gt;What&amp;rsquo;s next? 🔮&lt;/h2&gt;
&lt;p&gt;As noted, I did compromise on the 1TB M.2 SSD. I&amp;rsquo;ve come up with an aftermarket solution to upgrade to 2TB which I will post about soon. I chose a laptop pre-installed with Linux for two reasons:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Support companies shipping a Linux operating system pre-installed on their laptops and workstations&lt;/li&gt;
&lt;li&gt;Hard proof Linux works on their hardware&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;After using Ubuntu for a few weeks I switched to NixOS. I will be posting about my experience with NixOS on the Z13 in a future blog post and &lt;a href="https://twitch.tv/WimpysWorld"&gt;will likely livestream about it on Twitch&lt;/a&gt; as well. TL;DR NixOS 22.11 has fewer issues than Ubuntu 22.04 on the ThinkPad Z13 Gen 1.&lt;/p&gt;
&lt;p&gt;The ThinkPad Z13 Gen 1 is an excellent laptop for my requirements, and I have no regrets. If I were to buy I laptop pre-installed with a Linux distro in the future, I might go for Fedora, just so I can see what the OEM experience is like with Fedora.&lt;/p&gt;
&lt;p&gt;Since I purchased the Z13, &lt;a href="https://frame.work/gb/en/blog/framework-laptop-13-with-13th-gen-intel-core-and-amd-ryzen-7040-series"&gt;Framework has announced AMD 7040-series powered laptops&lt;/a&gt; are coming later in 2023; and I&amp;rsquo;m not sure I can resist&amp;hellip;&lt;/p&gt;</description><summary>Picking a thin and light Linux laptop with plenty of battery endurance</summary></item></channel></rss>