devenv
devenv
Use current official devenv sources, not stale model memory. devenv moves quickly and several option names differ from what older training data suggests.
This skill snapshot is written against devenv 2.1.x (verified on 2.1.2), current on 2026-06-12.
Verify the local version before relying on version-specific behavior: devenv version. If the repo or CI pins a different version, prefer that version's docs.
What devenv is (orientation)
devenv is a Nix-backed tool for declaring a project's whole dev environment in devenv.nix — packages, env vars, language toolchains, background services (databases, etc.), long-running processes, scripts, ordered tasks, git hooks, and tests. devenv.yaml declares inputs (the nixpkgs source and any extra flakes). devenv.lock pins every input to an exact revision. All three are committed. It exposes a simplified module system over Nix — you do not need flakes knowledge, but devenv.nix is a Nix file and must be valid Nix.
Start here
- Confirm the version and what already exists. Run
devenv version. Look fordevenv.nix,devenv.yaml,devenv.lock,.envrc. Read them before editing — match the existing structure and input pinning. - Prefer
languages.*andservices.*modules over rawpackages. Droppingpkgs.python312intopackagesskips the integration (env vars, venv wiring, PATH ordering) that the language module sets up. Reach forpackagesonly for plain CLI tools. - Verify option names against the live reference, don't guess. The options surface is large and renames happen (e.g. the git-hooks option is
git-hooks.hooks.*, not the olderpre-commit.hooks.*;devenv.yamluses snake_caseallow_unfree, notallowUnfree). When unsure, search:devenv search <term>or the options reference (see references/official-sources.md). - After editing, prove it evaluates. A config that looks right but doesn't build is worse than none. Run
devenv info(fast, evaluates the whole config) ordevenv shell true, and read the Nix error if it fails.