<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/">
  <channel>
    <title>Tutorial on paradigmatic.systems</title>
    <link>https://paradigmatic.systems/tags/tutorial/</link>
    <description>Recent content in Tutorial on paradigmatic.systems</description>
    <generator>Hugo -- gohugo.io</generator>
    <language>en-us</language>
    <lastBuildDate>Sun, 27 Jul 2025 14:30:00 +0000</lastBuildDate><atom:link href="https://paradigmatic.systems/tags/tutorial/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>Deploying Hugo in NixOS</title>
      <link>https://paradigmatic.systems/posts/getting-started-with-hugo/</link>
      <pubDate>Sun, 27 Jul 2025 14:30:00 +0000</pubDate>
      
      <guid>https://paradigmatic.systems/posts/getting-started-with-hugo/</guid>
      <description>&lt;p&gt;While my instinct is to use Phoenix for &lt;em&gt;everything&lt;/em&gt;, I had to admit it&amp;rsquo;s overkill for a personal website. I&amp;rsquo;m not here to flex complex backend integrations or live features. I&amp;rsquo;ve heard good things about Hugo, so maybe it&amp;rsquo;s time to try it. I will describe how &lt;code&gt;Nix&lt;/code&gt; and &lt;code&gt;deploy-rs&lt;/code&gt; allowed me to get framed out and deployed in one short and painless sitting!&lt;/p&gt;
&lt;p&gt;A quick google search yielded a serviceable &lt;a href=&#34;https://www.chrisportela.com/posts/this-site-is-a-flake/&#34;&gt;flake&lt;/a&gt; for a Hugo dev environment. So I just ran &lt;code&gt;nix develop&lt;/code&gt;, &lt;code&gt;hugo new site&lt;/code&gt; and then had a Claude agent throw in some placeholder content. 5 minutes later I had something serving on localhost.&lt;/p&gt;</description>
      <content:encoded><![CDATA[<p>While my instinct is to use Phoenix for <em>everything</em>, I had to admit it&rsquo;s overkill for a personal website. I&rsquo;m not here to flex complex backend integrations or live features. I&rsquo;ve heard good things about Hugo, so maybe it&rsquo;s time to try it. I will describe how <code>Nix</code> and <code>deploy-rs</code> allowed me to get framed out and deployed in one short and painless sitting!</p>
<p>A quick google search yielded a serviceable <a href="https://www.chrisportela.com/posts/this-site-is-a-flake/">flake</a> for a Hugo dev environment. So I just ran <code>nix develop</code>, <code>hugo new site</code> and then had a Claude agent throw in some placeholder content. 5 minutes later I had something serving on localhost.</p>
<p>It&rsquo;s placeholder slop but I decided to complete the loop and ship it. The nice thing is this flake also exports the built site as a package. Excellent! I verified that <code>nix build</code> succeeds.</p>
<p>Then I popped into my deployment repo that has the configuration for my NixOS VPS. The top-level flake gets a new input attribute that pulls in the Hugo repo from local storage: <code>inputs.paradigmatic.url = &quot;path:/path/to/paradigmatic.systems&quot;;</code>. Then my <code>nginx</code> config gets a new entry:</p>
<pre tabindex="0"><code>virtualHosts.&#34;paradigmatic.systems&#34; = {
  enableACME = true;
  forceSSL = true;
  root = &#34;${paradigmatic.packages.${system}.website}&#34;;
};
</code></pre><p>Just like that, I&rsquo;ve got a new reverse proxy serving this static site. Since I already have <code>deploy-rs</code> set up, a simple <code>deploy</code> command kicks of the Nix magic which does the build and sends up the new system. Deployment failed the first time because the Acme certificates hadn&rsquo;t gone through. But thanks to magic rollbacks, the system was uninterrupted.</p>
<p>At time of writing my NixOS flake has 4 different projects coexisting. The flake basically does the job of pulling in different repos that each contain their own packaging instructions. For a more complex (Phoenix) application there is also a module definition that lets me enable and configure the service. So in addition to the input and <code>nginx</code> config we&rsquo;d have something like:</p>
<pre tabindex="0"><code>services.phoenix-app = {
  enable = true;
  port = 4002;
  host = &#34;phoenix-app.com&#34;;
  secretKeyBase = &#34;&#34;;
};
</code></pre><p>I have some lingering curiosity that I&rsquo;d like to state and follow up on.</p>
<blockquote>
<p>When I run <code>nix flake update</code> it pulls all the input repos into the nix store and updates the lock file. Are those store paths immune from garbage collection? What if I was in some silly situation where the nix store has the actual valid copy of what I&rsquo;m deploying, but the source is corrupted?</p></blockquote>
]]></content:encoded>
    </item>
    
  </channel>
</rss>
