<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Determinate Nix on Wimpy's World</title><link>https://blog.wimpys.world/tags/determinate-nix/</link><description>Recent content in Determinate Nix 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/determinate-nix/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></channel></rss>