Service modules, port allocation, and process watching in devenv devenv

Background

devenv is a Nix-based tool for declarative, reproducible developer environments, combining languages, packages, services, and processes in a single file. This site is built with it.

Contribution

  • added the services.mosquitto module, with tests and documentation
  • worked on the MongoDB module, including services.mongodb.replication
  • improved RabbitMQ port allocation for distribution and EPMD ports
  • allocated OpenTelemetry Collector listener ports
  • fixed process watching so that processes are not restarted on irrelevant file events
  • tightened dynamic port allocation and evaluation-cache behaviour
  • added regression tests for port allocation across repositories

Discussion

When working across many projects, an environment tool is either unobtrusive or a source of friction. Port collisions between repositories and spurious restarts are typical examples of the latter, and are a common reason for abandoning reproducible environments altogether.