<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
    <title>hamidr</title>
    <subtitle>Notes on software, systems, and the occasional proof.</subtitle>
    <link rel="self" type="application/atom+xml" href="https://hamidr.github.io/atom.xml"/>
    <link rel="alternate" type="text/html" href="https://hamidr.github.io"/>
    <generator uri="https://www.getzola.org/">Zola</generator>
    <updated>2026-09-06T00:00:00+00:00</updated>
    <id>https://hamidr.github.io/atom.xml</id>
    <entry xml:lang="en">
        <title>nixcage</title>
        <published>2026-09-06T00:00:00+00:00</published>
        <updated>2026-09-06T00:00:00+00:00</updated>
        
        <author>
          <name>
            
              Hamid
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://hamidr.github.io/posts/nixcage/"/>
        <id>https://hamidr.github.io/posts/nixcage/</id>
        
        <content type="html" xml:base="https://hamidr.github.io/posts/nixcage/">&lt;p&gt;&lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;github.com&#x2F;hamidr&#x2F;nixcage&quot;&gt;nixcage&lt;&#x2F;a&gt; gives every project its own
systemd-nspawn container, built from the project&#x27;s own &lt;code&gt;devShells.default&lt;&#x2F;code&gt;.
There is no &lt;code&gt;nixcage init&lt;&#x2F;code&gt; and no nixcage file in the repository: the devShell
is the entire interface.&lt;&#x2F;p&gt;
&lt;p&gt;Inside the container a project sees only its own directory, its own persistent
home, and the Nix store read-only. Two projects on the same machine cannot
reach each other&#x27;s source, and neither can whatever their toolchains decide to
run.&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color-scheme: light dark; color: light-dark(#24292E, #E1E4E8); background-color: light-dark(#FFFFFF, #24292E);&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: light-dark(#6F42C1, #B392F0);&quot;&gt;nix&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#032F62, #9ECBFF);&quot;&gt; profile&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#032F62, #9ECBFF);&quot;&gt; install&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#032F62, #9ECBFF);&quot;&gt; github:hamidr&#x2F;nixcage&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: light-dark(#005CC5, #79B8FF);&quot;&gt;cd&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#032F62, #9ECBFF);&quot;&gt; ~&#x2F;Src&#x2F;some-project&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: light-dark(#6F42C1, #B392F0);&quot;&gt;nixcage&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#032F62, #9ECBFF);&quot;&gt; enter&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;On Linux the container runs natively on the host. macOS has no containers, so
the same container runs inside one shared NixOS microVM whose only job is to
provide a Linux kernel. That boots once and serves every project, and it adds a
VM boundary between the containers and the host.&lt;&#x2F;p&gt;
&lt;p&gt;The CLI is small: &lt;code&gt;enter&lt;&#x2F;code&gt;, &lt;code&gt;exec&lt;&#x2F;code&gt;, &lt;code&gt;rm&lt;&#x2F;code&gt;, &lt;code&gt;status&lt;&#x2F;code&gt;, plus &lt;code&gt;rebuild&lt;&#x2F;code&gt; and &lt;code&gt;down&lt;&#x2F;code&gt; on
macOS where the VM lifecycle is yours to manage. Configuration is a NixOS
module on Linux and a config flake at &lt;code&gt;~&#x2F;.config&#x2F;nixcage&lt;&#x2F;code&gt; on macOS, so the VM
is an ordinary NixOS system you own.&lt;&#x2F;p&gt;
&lt;p&gt;Secrets come from sops-nix and are injected per session:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color-scheme: light dark; color: light-dark(#24292E, #E1E4E8); background-color: light-dark(#FFFFFF, #24292E);&quot;&gt;&lt;code data-lang=&quot;nix&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: light-dark(#E36209, #FFAB70);&quot;&gt;nixcage&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#D73A49, #F97583);&quot;&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#E36209, #FFAB70);&quot;&gt;secretEnv&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#D73A49, #F97583);&quot;&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#E36209, #FFAB70);&quot;&gt;ANTHROPIC_API_KEY&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#B31D28, #FDAEB7);font-style: italic;&quot;&gt; =&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#032F62, #9ECBFF);&quot;&gt; &amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#032F62, #9ECBFF);&quot;&gt;anthropic&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#032F62, #9ECBFF);&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#B31D28, #FDAEB7);font-style: italic;&quot;&gt;;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Four exported primitives (&lt;code&gt;enter&lt;&#x2F;code&gt;, &lt;code&gt;uid&lt;&#x2F;code&gt;, &lt;code&gt;storage ensure&lt;&#x2F;code&gt;, and &lt;code&gt;exec&lt;&#x2F;code&gt;) are the
whole interface for tools built on top; you name paths and principals, nixcage
names datasets and numbers.&lt;&#x2F;p&gt;
&lt;p&gt;GPLv3. README and ADRs are in the repository.&lt;&#x2F;p&gt;
</content>
        
    </entry>
    <entry xml:lang="en">
        <title>Hello</title>
        <published>2026-08-12T00:00:00+00:00</published>
        <updated>2026-08-12T00:00:00+00:00</updated>
        
        <author>
          <name>
            
              Hamid
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://hamidr.github.io/posts/hello/"/>
        <id>https://hamidr.github.io/posts/hello/</id>
        
        <content type="html" xml:base="https://hamidr.github.io/posts/hello/">&lt;p&gt;This site is a Zola project built inside a Nix flake, so the toolchain is pinned
and the output is reproducible.&lt;&#x2F;p&gt;
&lt;p&gt;Preview it locally:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color-scheme: light dark; color: light-dark(#24292E, #E1E4E8); background-color: light-dark(#FFFFFF, #24292E);&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: light-dark(#6F42C1, #B392F0);&quot;&gt;nix&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#032F62, #9ECBFF);&quot;&gt; develop&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#005CC5, #79B8FF);&quot;&gt; -&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#005CC5, #79B8FF);&quot;&gt;-command&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#032F62, #9ECBFF);&quot;&gt; zola&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#032F62, #9ECBFF);&quot;&gt; serve&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Build the deployable tree:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color-scheme: light dark; color: light-dark(#24292E, #E1E4E8); background-color: light-dark(#FFFFFF, #24292E);&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: light-dark(#6F42C1, #B392F0);&quot;&gt;nix&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#032F62, #9ECBFF);&quot;&gt; build&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;The result is a plain directory of HTML under &lt;code&gt;.&#x2F;result&lt;&#x2F;code&gt;, which any static host
will serve as-is.&lt;&#x2F;p&gt;
</content>
        
    </entry>
</feed>
