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