devenv is a free, open source frameworks & platforms project written in Rust and released under Apache-2.0. It has 7,731 GitHub stars, 577 forks and 388 open issues, and was last pushed 42 hours ago. On this registry it ranks #52 of 116 tracked projects in Frameworks & Platforms, with 5 head-to-head comparisons available.

What is devenv?

devenv is a fast, declarative, reproducible, and composable way to define developer environments on Nix, aimed at developers and teams who want toolchains, services, and processes declared as code rather than handed down as setup instructions.

What it is

devenv is a developer environment framework built on the Nix ecosystem, written in Rust and licensed under Apache-2.0, from the same organisation that maintains Cachix. It lets you describe an environment in a devenv.nix file — languages, packages, services, processes, tasks, and scripts — and then enter it, share it, and rebuild it reproducibly on any machine running Nix. Its feature set spans a terminal UI with live build progress, an LSP for devenv.nix itself, and a native process manager, so the environment definition covers far more than a package list.

The concrete problem it addresses is environment drift: each developer on a team ends up with a differently configured shell, a different language version, and a differently run database, and getting a new machine working means following a wiki page of shell commands. By declaring everything in one composable configuration, devenv replaces that hand-maintained setup with something that can be imported, pinned through inputs, and reproduced identically across Linux, macOS, x64, and ARM64 — including WSL2.

Key capabilities

  • Provides built-in tooling for over 50 languages, including compilers, LSP servers, formatters, linters, and version selection, plus access to more than 100,000 packages from Nixpkgs.
  • Runs over 40 services such as PostgreSQL, Redis, MySQL, MongoDB, Elasticsearch, and Caddy, and devenv test automatically starts and stops those processes around a test run.
  • Ships a native Rust process manager with dependency ordering, restart policies, readiness probes (exec, HTTP, systemd notify), socket activation, watchdog heartbeats, and file watching.
  • Allocates free ports automatically so parallel environments never collide, and executes tasks with DAG-based ordering, caching, parallel runs, and namespace support.
  • Supports ad hoc environments from the CLI with no config file, for example --option languages.rust.enable:bool true, and out-of-tree configurations pulled with --from github:myorg/configs.
  • Builds OCI containers directly from your environment without Docker, and produces packaging outputs using each language's own tooling, such as crate2nix and uv2nix.
  • Composes environments through imports and profiles (for example --profile backend --profile testing), pins Nix dependencies through inputs, and manages secrets declaratively via SecretSpec with keyring, 1Password, and dotenv providers.

Who uses it and how

  • Teams working across several repositories use polyrepo support to reference outputs and options across repositories while keeping one shared configuration.
  • Developers on constrained or unusual hosts run it on x64 and ARM64, including under WSL2, from the same declarative file.
  • Backend developers bring up local dependencies such as PostgreSQL or Elasticsearch alongside their application, with readiness probes and automatic port allocation letting two environments run side by side.
  • Maintainers who want environments reused across projects share them via imports and out-of-tree configs pulled from an organisation's own repository.
  • Contributors wire formatting and linting into CI through git-hooks.nix, and use devenv test to validate changes against a running service.

Getting started

Follow the installation and quick-start instructions at https://devenv.sh, with versioned releases published on the GitHub releases page at github.com/cachix/devenv.

How it compares

No comparable or paid products are named in the available facts, so devenv stands alone in this registry; the closest reference points are the upstream projects it builds on — Nix itself and Nixpkgs, plus git-hooks.nix for git hooks — which it wraps rather than competes with.

When to use it — and when not

It is a good fit only if you are prepared to operate Nix and the things your configuration declares: a process manager, one or more services, storage for their data, and any credentials handed to SecretSpec. The project carries 388 open issues, so expect active rough edges rather than a settled surface, and it is a poor choice for teams that cannot adopt Nix at all or that want a plain container image and a script instead of a declarative environment.

project readme (upstream, from github) — read inline

devenv.sh - Fast, Declarative, Reproducible, and Composable Developer Environments

Built with devenv Built with Nix Discord channel License: Apache 2.0 Version CI

Features

Developer experience

Languages, packages, and services

  • 50+ languages with built in tooling: compilers, LSP servers, formatters, linters, and version selection
  • 100,000+ packages from Nixpkgs for Linux, macOS, x64, and ARM64 (including WSL2)
  • 40+ services like PostgreSQL, Redis, MySQL, MongoDB, Elasticsearch, Caddy, and more

Processes and tasks

  • Native process manager written in Rust with dependency ordering, restart policies, readiness probes (exec, HTTP, systemd notify), socket activation, watchdog heartbeats, and file watching
  • Automatic port allocation that finds free ports so parallel environments never collide
  • Tasks with DAG based execution, caching, parallel runs, and namespace support
  • Scripts with access to all environment packages

Packaging and deployment

  • OCI containers built from your environment without Docker
  • Outputs for packaging apps using each language's best tools (crate2nix, uv2nix, ...)
  • Polyrepo support to reference outputs and options across repositories

Composition and configuration

  • Profiles for environment variants (--profile backend --profile testing)
  • Composable via imports to share and reuse environments across projects
  • Inputs for pinning and overriding Nix dependencies

Security and integrations

  • SecretSpec for declarative, provider agnostic secrets management (keyring, 1Password, dotenv)
  • Git hooks via git-hooks.nix with pre configured formatters and linters
  • Testing with devenv test that automatically starts and stops processes
  • direnv integration for automatic shell activation when entering a directory
  • MCP server for AI assistant integration (package and option search)
  • AI generation to scaffold environments from a natural language description

Quick start

Running devenv init generates devenv.nix:

{ pkgs, lib, config, inputs, ... }:

{
  # https://devenv.sh/basics/
  env.GREET = "devenv";

  # https://devenv.sh/packages/
  packages = [ pkgs.git ];

  # https://devenv.sh/languages/
  # languages.rust.enable = true;

  # https://devenv.sh/processes/
  # processes.dev.exec = "${lib.getExe pkgs.watchexec} -n -- ls -la";

  # https://devenv.sh/services/
  # services.postgres.enable = true;

  # https://devenv.sh/scripts/
  scripts.hello.exec = ''
    echo hello from $GREET
  '';

  # https://devenv.sh/basics/
  enterShell = ''
    hello         # Run scripts directly
    git --version # Use packages
  '';

  # https://devenv.sh/tasks/
  # tasks = {
  #   "myproj:setup".exec = "mytool build";
  #   "devenv:enterShell".after = [ "myproj:setup" ];
  # };

  # https://devenv.sh/tests/
  enterTest = ''
    echo "Running tests"
    git --version | grep --color=auto "${pkgs.git.version}"
  '';

  # https://devenv.sh/outputs/
  # outputs = {
  #   rust-app = config.languages.rust.import ./rust-app {};
  #   python-app = config.languages.python.import ./python-app {};
  # };

  # https://devenv.sh/git-hooks/
  # git-hooks.hooks.shellcheck.enable = true;

  # See full reference at https://devenv.sh/reference/options/
}

And devenv shell activates the environment.

Commands

$ devenv
https://devenv.sh 2.0.0: Fast, Declarative, Reproducible, and Composable Developer Environments

Usage: devenv [OPTIONS] [COMMAND]

Commands:
  init        Scaffold devenv.yaml, devenv.nix, and .gitignore.
  generate    Generate devenv.yaml and devenv.nix using AI
  shell       Activate the developer environment. https://devenv.sh/basics/
  update      Update devenv.lock from devenv.yaml inputs. http://devenv.sh/inputs/
  search      Search for packages and options in nixpkgs. https://devenv.sh/packages/#searching-for-a-file
  info        Print information about this developer environment.
  up          Start processes in the foreground. https://devenv.sh/processes/
  processes   Start or stop processes. https://devenv.sh/processes/
  tasks       Run tasks. https://devenv.sh/tasks/
  test        Run tests. http://devenv.sh/tests/
  container   Build, copy, or run a container. https://devenv.sh/containers/
  inputs      Add an input to devenv.yaml. https://devenv.sh/inputs/
  changelogs  Show relevant changelogs.
  repl        Launch an interactive environment for inspecting the devenv configuration.
  gc          Delete previous shell generations. See https://devenv.sh/garbage-collection
  build       Build any attribute in devenv.nix.
  eval        Evaluate any attribute in devenv.nix and return JSON.
  direnvrc    Print a direnvrc that adds devenv support to direnv. See https://devenv.sh/integrations/direnv/.
  version     Print the version of devenv.
  mcp         Launch Model Context Protocol server for AI assistants
  lsp         Start the nixd language server for devenv.nix.
  help        Print this message or the help of the given subcommand(s)

Input overrides:
      --from <FROM>
          Source for devenv.nix.

          Can be either a filesystem path (with path: prefix) or a flake input reference.

          Examples:
            --from github:cachix/devenv
            --from github:cachix/devenv?dir=examples/simple
            --from path:/absolute/path/to/project
            --from path:./relative/path

  -o, --override-input <NAME> <URI>
          Override inputs in devenv.yaml.

          Examples:
            --override-input nixpkgs github:NixOS/nixpkgs/nixos-unstable
            --override-input nixpkgs path:/path/to/local/nixpkgs

  -O, --option <OPTION:TYPE> <VALUE>
          Override configuration options with typed values.

          OPTION must include a type: <attribute>:<type>
          Supported types: string, int, float, bool, path, pkg, pkgs

          List types (pkgs) append to existing values by default.
          Add a ! suffix to replace instead: pkgs!

          Examples:
            --option languages.rust.channel:string beta
            --option services.postgres.enable:bool true
            --option languages.python.version:string 3.10
            --option packages:pkgs "ncdu git"       (appends to packages)
            --option packages:pkgs! "ncdu git"      (replaces all packages)

Nix options:
  -j, --max-jobs <MAX_JOBS>
          Maximum number of Nix builds to run concurrently.

          Defaults to 1/4 of available CPU cores (minimum 1).

          [env: DEVENV_MAX_JOBS=]

  -u, --cores <CORES>
          Number of CPU cores available to each build.

          Defaults to available cores divided by max-jobs (minimum 1).

          [env: DEVENV_CORES=]

  -s, --system <SYSTEM>
          Override the target system.

          Defaults to the host system (e.g. aarch64-darwin, x86_64-linux).

  -i, --impure
          Relax the hermeticity of the environment.

      --no-impure
          Force a hermetic environment, overriding config.

      --offline
          Disable substituters and consider all previously downloaded files up-to-date.

      --nix-option <NAME> <VALUE>
          Pass additional options to nix commands.

          These options are passed directly to Nix using the --option flag.
          See `man nix.conf` for the full list of available options.

          Examples:
            --nix-option sandbox false
            --nix-option keep-outputs true
            --nix-option system x86_64-darwin

      --nix-debugger
          Enter the Nix debugger on failure.

Shell options:
  -c, --clean [<CLEAN>...]
          Ignore existing environment variables when entering the shell. Pass a list of comma-separated environment variables to let through.

  -P, --profile <PROFILES>
          Activate one or more profiles defined in devenv.nix.

          Profiles allow you to define different configurations that can be merged with your base configuration.

          See https://devenv.sh/profiles for more information.

          Examples:
            --profile python-3.14
            --profile backend --profile fast-startup

      --reload
          Enable auto-reload when config files change (default).

      --no-reload
          Disable auto-reload when config files change.

Cache options:
      --eval-cache
          Enable caching of Nix evaluation results (default).

      --no-eval-cache
          Disable caching of Nix evaluation results.

      --refresh-eval-cache
          Force a refresh of the Nix evaluation cache.

      --refresh-task-cache
          Force a refresh of the task cache.

Secretspec options:
      --secretspec-provider <SECRETSPEC_PROVIDER>
          Override the secretspec provider

          [env: SECRETSPEC_PROVIDER=]

      --secretspec-profile <SECRETSPEC_PROFILE>
          Override the secretspec profile

          [env: SECRETSPEC_PROFILE=]

Tracing options:
      --trace-output <TRACE_OUTPUT>
          Enable tracing and set the output destination: stdout, stderr, or file:<path>. Tracing is disabled by default.

          [env: DEVENV_TRACE_OUTPUT=]

      --trace-format <TRACE_FORMAT>
          Set the trace output format. Only takes effect when tracing is enabled via --trace-output.

          Possible values:
          - full:   A verbose structured log format used for debugging
          - json:   A JSON log format used for machine consumption
          - pretty: A pretty human-readable log format used for debugging

          [env: DEVENV_TRACE_FORMAT=]
          [default: json]

Global options:
  -v, --verbose
          Enable additional debug logs.

  -q, --quiet
          Silence all logs

      --tui
          Enable the interactive terminal interface (default when interactive).

          [env: DEVENV_TUI=]

      --no-tui
          Disable the interactive terminal interface.

  -h, --help
          Print help (see a summary with '-h')

  -V, --version
          Print version information and exit

Documentation

Frequently asked questions

Is devenv free to use?

devenv is open source under the Apache-2.0 licence. There is no licence fee and no seat count — you can self-host it or, where the project offers one, pay a vendor for a managed version instead.

What does devenv do?

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

What is devenv written in?

devenv is primarily written in Rust. Its source is publicly available at https://github.com/cachix/devenv, and it has 7,731 GitHub stars.