Could Nix and devenv replace Docker Compose?

I started using the Nix package manager in September 2022 as a replacement for Ansible to manage my dotfiles.

Since then, I've switched to daily-driving NixOS as my main operating system and started to use Nix instead of Docker for some development projects.

Even though I'm running Linux, there's a benefit to not running containers for simple projects as well as the reproducibility that Nix provides.

I hadn't invested much time in using Nix as Docker replacement for Drupal projects, but this week, I've started to look at devenv - a development tool based on Nix.

As well as declaring and locking the package versions I need for each project, it also manages the services I need, such as PHP-FPM and MariaDB or MySQL.

It also configures Git hooks, test scripts and custom processes, such as running Tailwind CSS.

I've configured it for a few projects this week and it could be a potential Docker replacement for me.

If you want to see an example, see this repo on GitHub.