oliverdavies.uk/source/_daily_emails/2025-01-20.md
2025-01-26 01:54:57 +00:00

1.2 KiB

title date permalink tags cta snippet
Reproducible or repeatable 2025-01-20 daily/2025/01/20/reproducible
software-development
nix
linux
php
~ Is your software environment reproducible or just repeatable?

In yesterday's email, I showed how I've been using Nix and flake files to build reproducible and shareable development environments for Drupal applications.

The reason it's reproducible is the flake.lock file.

Similar to composer.lock or package-lock.json, it captures the exact versions of the packages installed from the nixpkgs repository.

This file, along with flake.nix, can be committed alongside the application code and anyone with Nix installed can run nix develop to get a shell with the same packages and dependencies.

This isn't the same as other solutions, where you add something like FROM php:8.2 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.

With flake.lock, the environment isn't just repeatable - it's completely reproducible.

Locally, in a CI pipeline or in production.