devenv is a fast, declarative, and reproducible developer environment tool built on top of Nix. It lets you define your entire development setup — packages, environment variables, services, scripts, and more — in a singleDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/cachix/devenv/llms.txt
Use this file to discover all available pages before exploring further.
devenv.nix file that works identically across Linux, macOS, and Windows (via WSL2).
Nix is the package manager that powers devenv. Choose your platform to get the right install command:
Linux
macOS
The installer above is the recommended option for macOS. It handles OS upgrades and has better support for Apple silicon. If you prefer the classic installer, use:
- Nix env (newcomers)
- Nix profiles (requires experimental flags)
Windows (WSL2)
Docker
Nix env (newcomers)
Nix profiles (requires experimental flags)
NixOS / nix-darwin
Add devenv to your system packages in
configuration.nix: home-manager
Add devenv to your user packages in
home.nix:The Nix ecosystem relies heavily on GitHub for hosting and distributing source code, including Nixpkgs itself. Without authentication, Nix makes many unauthenticated requests to the GitHub API, which can trigger rate limiting — especially on fresh installs or CI machines.
Create a token with no extra permissions at https://github.com/settings/personal-access-tokens/new, then add it to
~/.config/nix/nix.conf:devenv.nix — the main environment definition: packages, services, scripts, environment variables, and more.devenv.yaml — declares inputs (e.g., Nixpkgs version) and imports..gitignore — pre-populated with entries for devenv’s generated state directories.Key Commands
Once your environment is initialized, devenv provides a rich set of commands for day-to-day development:| Command | Description |
|---|---|
devenv init | Scaffold devenv.yaml, devenv.nix, and .gitignore |
devenv generate | Generate devenv.yaml and devenv.nix using AI |
devenv shell | Activate the developer environment |
devenv test | Build the environment and run all checks (useful in CI) |
devenv search <NAME> | Search packages matching NAME in the Nixpkgs input |
devenv update | Update and pin inputs from devenv.yaml into devenv.lock |
devenv gc | Delete unused environments to free disk space |
devenv up | Start processes in the foreground |
devenv processes down | Stop background processes |
devenv info | Print a summary of the current environment |
devenv build <attr> | Build an attribute from devenv.nix |
devenv eval <attr> | Evaluate an attribute and return JSON |
devenv repl | Launch an interactive Nix REPL for inspecting the environment |
devenv tasks run <task> | Run tasks |
devenv container build|copy|run | Manage containers |
devenv inputs add <name> <url> | Add an input to devenv.yaml |
devenv lsp | Start the nixd language server for devenv.nix |
devenv mcp | Launch the MCP server for AI assistant integration |
Updating
Update the devenv CLI
- Nix env (newcomers)
- Nix profiles (requires experimental flags)
- NixOS / nix-darwin / home-manager
Update project inputs
Inputs such as Nixpkgs and devenv modules are downloaded and pinned in adevenv.lock lockfile. Periodically refresh them with:
Learn more about managing inputs in the Inputs guide.
