Skip to content
Latest from the blogJul 28, 2026devenv 2.2: attach to running processes and persistent out-of-tree environments

Developer Environments using Nix

Your whole development
environment, declared.

Define packages, languages, services, tasks, secrets, and tooling once. Give every developer—and CI—the same fast, reproducible environment.

Describe your stack

View examples

Generates a complete devenv.nix via devenv.new

devenv.nix · preview
{ pkgs, ... }: {
languages.rust.enable = true;

services.postgres = {
enable = true;
initialDatabases = [{ name = "app"; }];
};

packages = [ pkgs.cargo-watch ];
}
<100ms
cached shell startup
100k+
prebuilt packages
58
languages
Linux · macOS · WSL
x64 · ARM64

Languages · Services · Tools

Rust
Python
Node.js
Go
Ruby
PHP
TypeScript
Elixir
Kotlin
Swift
Haskell
Scala
.NET
Lua
Erlang
OCaml
Perl
Dart
C++
Nim
Crystal
Zig
R
Julia
Rust
Python
Node.js
Go
Ruby
PHP
TypeScript
Elixir
Kotlin
Swift
Haskell
Scala
.NET
Lua
Erlang
OCaml
Perl
Dart
C++
Nim
Crystal
Zig
R
Julia
PostgreSQL
Redis
MySQL
MongoDB
MariaDB
Elasticsearch
RabbitMQ
MinIO
Caddy
nginx
ClickHouse
NATS
Meilisearch
CouchDB
InfluxDB
OpenSearch
Keycloak
Vault
Kafka
PostgreSQL
Redis
MySQL
MongoDB
MariaDB
Elasticsearch
RabbitMQ
MinIO
Caddy
nginx
ClickHouse
NATS
Meilisearch
CouchDB
InfluxDB
OpenSearch
Keycloak
Vault
Kafka
Docker
Nix
GitHub Actions
VS Code
IntelliJ
Zed
Android
WordPress
Terraform
OpenTofu
Claude Code
Linux
macOS
Docker
Nix
GitHub Actions
VS Code
IntelliJ
Zed
Android
WordPress
Terraform
OpenTofu
Claude Code
Linux
macOS

Three steps. Done.

From zero to a reproducible environment your whole team can use.

1

Install

Once Nix is installed. Works on Linux, macOS, and WSL.

$ nix profile install nixpkgs#devenv
2

Initialize & describe

Scaffold the project, then edit devenv.nix or generate it from a prompt above.

$ devenv init
$EDITOR devenv.nix
3

Activate

Everything available, in under 100ms after the first build.

$ devenv shell
(devenv) $ cargo run

Your whole stack, declared together

Languages, services, processes, tasks, secrets — all declarative.

58

Languages

Python, Rust, Go, Node, Ruby, PHP, Java, Elixir, and more — with version pinning and LSP servers.

Services

42 preconfigured services, including PostgreSQL, Redis, MySQL, RabbitMQ, MinIO, Caddy, and Elasticsearch.

services.postgres.enable = true;
services.redis.enable = true;

Processes

Declarative process management with logs, restarts, and dependencies. Just devenv up.

Tasks & git hooks

Define dependencies, run in parallel, hook into your shell or commits. Linters, formatters, codegen.

tasks."app:build" = {
exec = "yarn build";
before = [ "devenv:enterShell" ];
};

SecretSpec

Declarative secrets from Keychain, 1Password, LastPass, or dotenv. Keep values out of config and committed .env files.

processes.api.exec =
"secretspec run -- npm start";

Containers

Build OCI containers from your dev environment. Same packages, same versions, same behavior.

Tests

Run integration tests with all processes active. devenv test and done.

Basics

Packages, variables, files, and scripts in native bash, zsh, fish, or nushell. Auto-activate on cd and apply updates at the next prompt.

Ad-hoc shells — zero config

Spin up a temporary environment without writing a devenv.nix. Great for experiments, scripts, and CI matrices.

$ devenv -O languages.python.enable:bool true \
-O languages.python.version:string "3.12" \
shell

Search packages & options

Search 100,000+ packages and every devenv option from the CLI, using the exact Nixpkgs version pinned by your project.

$ devenv search postgres
pkgs.postgresql_17
services.postgres.enable
Evaluation caching

Warm shells in milliseconds.

Auto-invalidated evaluation caching skips unchanged work. No daemons. No manual cache management. How it works.

Cached shell startup

<100ms

Cold
4832 ms
Warm
47 ms

Same config. ~100× faster on every subsequent shell.

Composability

Many environments. One shell.

Import config across folders and repositories. First-class monorepo support.

frontend/devenv.nix
languages.javascript.enable = true;
backend/devenv.nix
languages.rust.enable = true;
services.postgres.enable = true;
github:myorg/shared
services.redis.enable = true;
Unified environment
$ devenv shell
noderustpostgresredis
Profiles

One project. Every workflow.

Switch between frontend, backend, testing, and full-stack environments without duplicating configuration. Layer profiles manually or activate them by hostname and user.

$ devenv --profile backend shell
postgresredisAPI tools
$ devenv --profile fullstack up
backendfrontenddev server
hostname.ci-runner + user.alice
automaticdeterministic priority
devenv.nix
profiles = {
backend.module = {
services.postgres.enable = true;
services.redis.enable = true;
};

frontend.module = {
languages.javascript.enable = true;
processes.dev.exec = "npm run dev";
};

fullstack.extends = [ "backend" "frontend" ];
};
postgresrunning
port :5432 · uptime 3m 12s
ready probe: pg_isready
redisrunning
port :6379 · uptime 3m 12s
restart: on-failure
migratecompleted
one-shot · exit 0
after: postgres
apirunning
port :8080 · uptime 3m 09s
after: postgres, redis, migrate
socket activation · zero-downtime restarts

Declared once in devenv.nix. Started, ordered, restarted, and stopped by the native supervisor.

SecretSpec

Declare a secret. Swap the source.

The same declaration reads from Keychain, 1Password, dotenv, or env. Load secrets at runtime without committing their values.

secretspec.toml
[project]
name = "my-app"

[profiles.default]
DATABASE_URL = { required = true }
STRIPE_SECRET_KEY = { required = true }
Source: macOS Keychain
secretspec.toml declares DATABASE_URL
$ secretspec run -- npm start — exposed only to the app
Packaging

From dev shell to deployable artifact.

Same languages, same versions, same packages. Define outputs and ship a Nix derivation.

1 · Declare
devenv.nix
languages.rust.enable = true;
outputs.app =
config.languages.rust.import ./. {};
2 · Build
devenv build
$ devenv build outputs.app
Built /nix/store/...-app
in 12.4s
3 · Ship
Nix store · binary cache · CI
$ nix copy --to ssh://deploy \
/nix/store/...-app

Start building.

Set up your first environment in minutes — or generate one from the hero above.