gitmyhub

devenv

Rust ★ 7.1k updated 2d ago

Fast, Declarative, Reproducible, and Composable Developer Environments using Nix

A tool that sets up consistent, reproducible developer environments, languages, databases, and services, from one config file, powered by Nix under the hood but without requiring Nix knowledge.

RustNixDirenvsetup: moderatecomplexity 3/5

devenv is a tool for setting up developer environments: the collection of programming languages, libraries, databases, and background services a project needs to run. Instead of writing setup scripts or manually installing tools, you describe what you need in a single configuration file and devenv creates a consistent environment that works the same way on any machine where devenv is installed.

The tool is built on Nix, a package manager that tracks exactly which version of every tool is installed and isolates environments from each other so they do not conflict. You do not need to understand Nix to use devenv -- it provides its own simpler configuration format and handles the Nix layer for you. When you join a project or switch branches, one command gives you the correct versions of every compiler, database, and utility with no interference from other projects on the same computer.

devenv supports over 50 programming languages with built-in tooling such as compilers, formatters, and editor support, drawing from a catalog of over 100,000 packages. It can also start and manage background services like PostgreSQL, Redis, and MySQL, each configured in the same file. A native process manager written in Rust handles starting and stopping those services, managing dependencies between them, and restarting them if they crash.

Environment activation is fast: if nothing changed since the last run, the shell is ready in under 100 milliseconds. You can generate an initial configuration from a natural language description, load a shared configuration from another repository, or export the environment as a container image without requiring Docker. A direnv integration makes the environment activate automatically whenever you enter the project directory.

Where it fits