Hi, all,
I’m starting to use nix flakes for development of mostly Drupal sites, sometimes others, generally always with a need for a daemonized language runtime, a database, and a web server.
Most Drupal developers these days use a Docker-based solution – ddev is currently the leading one, but there are otthers. This is a pretty decent experience, but I’m wondering if I can get close with a Nix-based solution.
This is purely for development right now – I was trying to create a flake that would start all of these services and then drop into a devShell, but could only get the first running, was trying to fork and trap so I could have a command to start and stop the servers, and didn’t get there.
I’ve found that both Services-flake and Devenv are trying to solve this problem – would love to hear comparisons between them, or if there’s a simpler way to do this?
My goals are:
- Have an easy one-command
nix run
to download a project, start all the servers, and kick off an install script - Be able to start a new project with
nix flake init --template github://org/my-project
- Be able to run different language versions in different projects by changing a single line in the project’s flake
- Be able to run several projects simultaneously (on different ports)
- make this portable to run on Darwin/Windows
Would love to hear anybody’s experiences working with these!