<p><a href="/daily/2025/01/19/minimum-viable-development-environment">In yesterday's email</a>, I showed how I've been using Nix and flake files to build reproducible and shareable development environments for Drupal applications.</p>
<p>The reason it's reproducible is the <code>flake.lock</code> file.</p>
<p>Similar to <code>composer.lock</code> or <code>package-lock.json</code>, it captures the exact versions of the packages installed from the nixpkgs repository.</p>
<p>This file, along with <code>flake.nix</code>, can be committed alongside the application code and anyone with Nix installed can run <code>nix develop</code> to get a shell with the same packages and dependencies.</p>
<p>This isn't the same as other solutions, where you add something like <code>FROM php:8.2</code> but, because there's no lockfile, there's no guarantee the same package versions will be installed so there could be mismatches that cause errors.</p>
<p>With <code>flake.lock</code>, the environment isn't just repeatable - it's completely reproducible.</p>
<p>Locally, in a CI pipeline or in production.</p>
<p><a href="/daily/2025/01/19/minimum-viable-development-environment">In yesterday's email</a>, I showed how I've been using Nix and flake files to build reproducible and shareable development environments for Drupal applications.</p>
<p>The reason it's reproducible is the <code>flake.lock</code> file.</p>
<p>Similar to <code>composer.lock</code> or <code>package-lock.json</code>, it captures the exact versions of the packages installed from the nixpkgs repository.</p>
<p>This file, along with <code>flake.nix</code>, can be committed alongside the application code and anyone with Nix installed can run <code>nix develop</code> to get a shell with the same packages and dependencies.</p>
<p>This isn't the same as other solutions, where you add something like <code>FROM php:8.2</code> but, because there's no lockfile, there's no guarantee the same package versions will be installed so there could be mismatches that cause errors.</p>
<p>With <code>flake.lock</code>, the environment isn't just repeatable - it's completely reproducible.</p>
<p>Locally, in a CI pipeline or in production.</p>