devenv provides built-in process management with supervision, socket activation, file watching, and dependency management. You can define any number of named processes inDocumentation 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, start them all with a single command, and coordinate their startup order using dependency declarations and readiness probes.
Defining Processes
Add aprocesses block to devenv.nix. Each process needs at minimum an exec command:
devenv.nix
Starting and Stopping Processes
Dependencies
Processes can depend on other processes and tasks usingafter and before:
devenv.nix
Dependency Suffixes
Dependency suffixes control when a dependency is considered satisfied. For process dependencies:| Suffix | Satisfied when |
|---|---|
@started | the process has begun execution |
@ready (default) | the readiness probe passes |
@completed | the process finishes, regardless of exit code (soft dependency) |
| Suffix | Satisfied when |
|---|---|
@started | the task has begun execution |
@succeeded (default) | the task exits with code 0 |
@completed | the task finishes, regardless of exit code (soft dependency) |
Restart Policies
Control how processes restart when they exit:| Policy | Behavior |
|---|---|
on_failure (default) | restart only on non-zero exit |
always | restart on any exit |
never | never restart |
devenv.nix
Readiness Probes
Readiness probes let the process manager detect when a process is ready to serve. This is used byafter dependencies to know when a dependency is available.
Exec probe
Exec probe
Run a shell command to check readiness. Exit code 0 means ready:
devenv.nix
HTTP probe
HTTP probe
Poll an HTTP endpoint for readiness:
devenv.nix
Systemd notify probe
Systemd notify probe
Use systemd-style readiness notification. Your process should send
READY=1 to the socket path in $NOTIFY_SOCKET:devenv.nix
Probe Timing Options
All probe types support these timing options:devenv.nix
Socket Activation
Socket activation allows the process manager to bind sockets before starting your process, enabling zero-downtime restarts and lazy process startup.devenv.nix
LISTEN_FDS— number of passed file descriptorsLISTEN_PID— PID that should accept the socketsLISTEN_FDNAMES— colon-separated socket names
File Watching
Automatically restart processes when files change:devenv.nix
cargo run) is restarted on each change. A one-shot command that exits immediately is re-run on each change — the watcher stays active after the command exits.
devenv.nix
watch.paths entries are resolved relative to the location of your devenv.nix (the project root), not relative to the process’s cwd. Use path literals such as ./src rather than strings; they are passed to the watcher as absolute paths.Automatic Port Allocation
devenv can automatically allocate free ports for your processes, preventing conflicts when a port is already in use or when running multiple devenv projects simultaneously. Define ports usingports.<name>.allocate with a base port number. devenv will find a free port starting from that base, incrementing until one is available:
devenv.nix
config.processes.<name>.ports.<port>.value. If port 8080 is already in use, devenv will automatically try 8081, 8082, and so on.
This is particularly useful for:
- Running multiple projects — each project gets its own ports without manual coordination
- CI environments — tests can run in parallel without port conflicts
- Shared development machines — multiple developers can run the same project simultaneously
Strict Port Mode
If you want devenv to fail when a port is already in use instead of automatically finding the next available port, set the default indevenv.yaml:
devenv.yaml
Watchdog
Enable systemd-compatible watchdog monitoring. Your process must periodically sendWATCHDOG=1 to the notify socket, or it will be killed and restarted:
devenv.nix
Git Integration
Processes can reference the git repository root path using${config.git.root}, useful in monorepo environments:
devenv.nix
Processes as Tasks
Processes are automatically available as tasks with thedevenv:processes: prefix. This allows you to define pre and post hooks, create complex startup sequences, and use before/after dependency edges between tasks and processes interchangeably. See the Tasks documentation for details.
Alternative Process Managers
By default, devenv uses its native process manager. You can switch to alternative implementations:- process-compose — feature-rich external process manager with TUI
- overmind — Procfile-based with tmux integration
- honcho — Python Foreman port
- hivemind — simple Procfile manager
- mprocs — TUI process manager
devenv.nix
