<?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>Phoenix on paradigmatic.systems</title>
    <link>https://paradigmatic.systems/tags/phoenix/</link>
    <description>Recent content in Phoenix on paradigmatic.systems</description>
    <generator>Hugo -- gohugo.io</generator>
    <language>en-us</language>
    <lastBuildDate>Tue, 05 Aug 2025 04:30:00 +0000</lastBuildDate><atom:link href="https://paradigmatic.systems/tags/phoenix/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>The Power of Nix: Developing, Building, and Deploying a Phoenix App</title>
      <link>https://paradigmatic.systems/posts/phoenix-in-nix/</link>
      <pubDate>Tue, 05 Aug 2025 04:30:00 +0000</pubDate>
      
      <guid>https://paradigmatic.systems/posts/phoenix-in-nix/</guid>
      <description>&lt;p&gt;The inordinate usefulness of Nix really sinks in when you realize that it allows you to define a single piece of unified infrastructure for handling all the different parts of the software lifecycle. Furthermore, this infrastructure doesn&amp;rsquo;t even need to be project-specific. For a given class of projects, the &amp;ldquo;holy grail&amp;rdquo; Nix flake template defines all the following:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;All the &lt;strong&gt;dependencies&lt;/strong&gt;, pinned in the &lt;code&gt;flake.lock&lt;/code&gt; and updatable with &lt;code&gt;nix flake update&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;A &lt;strong&gt;dev environment&lt;/strong&gt; accessible with &lt;code&gt;nix develop&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;A &lt;strong&gt;package&lt;/strong&gt; derivation that encapsulates the build process in a &lt;code&gt;nix build&lt;/code&gt; command.&lt;/li&gt;
&lt;li&gt;A &lt;strong&gt;module&lt;/strong&gt; that exposes the app as a configurable system-level service that can be leveraged in integration checks with &lt;code&gt;nix flake check&lt;/code&gt;.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;With these things in place, activities that traditionally create overhead for developers (environment and deployment) are abstracted and standardized. And even though other tools solve similar problems, none of them achieve the universality of the Nix model. That&amp;rsquo;s because the most natural and complete description of software packaging is as pure functions over store paths. But in this post I&amp;rsquo;m focusing on convenience. The correctness of Nix, and the fact that correctness leads to convenience, are topics for a different post.&lt;/p&gt;</description>
      <content:encoded><![CDATA[<p>The inordinate usefulness of Nix really sinks in when you realize that it allows you to define a single piece of unified infrastructure for handling all the different parts of the software lifecycle. Furthermore, this infrastructure doesn&rsquo;t even need to be project-specific. For a given class of projects, the &ldquo;holy grail&rdquo; Nix flake template defines all the following:</p>
<ol>
<li>All the <strong>dependencies</strong>, pinned in the <code>flake.lock</code> and updatable with <code>nix flake update</code>.</li>
<li>A <strong>dev environment</strong> accessible with <code>nix develop</code>.</li>
<li>A <strong>package</strong> derivation that encapsulates the build process in a <code>nix build</code> command.</li>
<li>A <strong>module</strong> that exposes the app as a configurable system-level service that can be leveraged in integration checks with <code>nix flake check</code>.</li>
</ol>
<p>With these things in place, activities that traditionally create overhead for developers (environment and deployment) are abstracted and standardized. And even though other tools solve similar problems, none of them achieve the universality of the Nix model. That&rsquo;s because the most natural and complete description of software packaging is as pure functions over store paths. But in this post I&rsquo;m focusing on convenience. The correctness of Nix, and the fact that correctness leads to convenience, are topics for a different post.</p>
<p>I&rsquo;ve released some Nix infrastructure for Phoenix in a repo called <a href="https://github.com/roriholm/phoeNIX">PhoeNIX</a>. It&rsquo;s constructed, as is tradition, by copy-pasting from someone smarter (shoutout <a href="https://www.zekedou.live/">Zeke Dou</a> and <a href="https://github.com/jurraca">jurraca</a>) and then extending to meet my needs. I haven&rsquo;t seen any other flake templates for Phoenix that hit all 4 of my holy grail elements, so I hope this repo is useful for someone.</p>
<p>If you&rsquo;ve got a <a href="/posts/setting-up-deploy-rs">deploy-rs setup</a> for pushing system closures, then you can achieve a workflow that makes other DevOps, Cloud, and Containerization solutions look somewhat inadequate.</p>
]]></content:encoded>
    </item>
    
  </channel>
</rss>
