name: devenv description: Author, review, and operate devenv.sh developer environments (devenv.nix / devenv.yaml / devenv.lock) backed by Nix. Use whenever the user works with devenv — creating or editing devenv.nix, enabling languages/services/processes/scripts/tasks/git-hooks, wiring auto-activation (devenv hook / direnv), running devenv shell / up / test / tasks / update / gc, setting up a new project from scratch, or debugging a devenv build or activation failure. Trigger this even when the user says "dev environment", "reproducible shell", or names a devenv file without saying "devenv" explicitly.
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.
Classify the task first
Sort the request into one or more buckets, then load only the matching reference:
- Config authoring/editing —
devenv.nixstructure,env,packages,scripts,enterShell/enterTest,dotenv,devenv.yamlinputs/imports/follows, module args (pkgs/lib/config/inputs), Nix syntax pitfalls → references/config-reference.md - Language toolchains — enabling Python/JS/Rust/Go/etc., venv/uv/poetry, package-manager auto-install, native libraries, pinning versions → references/languages.md
- Services, processes, and tasks — databases and other
services.*, long-runningprocesses.*, process-compose dependencies/health checks, ordered/cachedtasks→ references/services-processes.md - Operating the environment — the CLI (
init/shell/up/test/tasks/update/gc/container/mcp/lsp), auto-activation viadevenv hookor direnv, CI, and troubleshooting build/activation failures → references/cli-operations.md - Finding the authoritative answer — exact doc URLs, how to search options/packages live, changelogs → references/official-sources.md
Setting up a project from scratch (common path)
devenv initscaffoldsdevenv.nix,devenv.yaml, and appends to.gitignore. Run it in the project root (a git repo). Don't hand-write the scaffold — letinitproduce the current template, then edit.- Enable the language module(s) the project needs and turn on the package manager's auto-install so dependencies install on activation (see references/languages.md).
- Add any
services.*the app talks to (Postgres, Redis, …). Remember services only run underdevenv up— enabling one does not start it (see references/services-processes.md). - Wire auto-activation so the environment loads on
cd: nativedevenv hook+devenv allow, or direnv. See references/cli-operations.md. - Commit
devenv.nix,devenv.yaml,devenv.lock, and.envrc(if used). Never commit.devenv/,.direnv/, ordevenv.local.nix—initgitignores these. - Verify:
devenv info, thendevenv shelland run the project's smoke command.
Review heuristics
When reviewing or fixing a devenv config, check whether:
- Toolchains use
languages.*modules rather than being smuggled in throughpackages. - Each
services.*/languages.*/ package-manager block that should be active actually hasenable = true— most default to off, and version/option keys do nothing without it. - The config still evaluates (
devenv info) — verify, don't assume. devenv.lockis committed anddevenv updateis run only intentionally (it bumps pinned versions; running it casually causes surprise upgrades).- Heavy setup lives in
tasks(cacheable viaexecIfModified, ordered, also run fordevenv test) rather than bloatingenterShell, which should stay fast because it runs on every activation. processes/servicesaren't assumed to be running just because they're declared — they requiredevenv up.- Secrets aren't being placed where they land in the world-readable Nix store (prefer
dotenv/ a secrets integration over inlining intoenv). - Git-hooks use the current
git-hooks.hooks.*option, not the deprecatedpre-commit.hooks.*.
Reference map
- references/config-reference.md —
devenv.nixanatomy,devenv.yamlinputs/imports/follows, env vars devenv sets, files to commit vs ignore, Nix syntax pitfalls. - references/languages.md — language modules, venv/uv/poetry, JS package managers, Rust channels, version pinning, native libraries.
- references/services-processes.md —
services.*(Postgres et al.),processes.*, process-compose dependencies/health,tasksordering and caching. - references/cli-operations.md — full CLI reference, auto-activation, CI/
devenv test, garbage collection,mcp/lsp, and a troubleshooting playbook. - references/official-sources.md — canonical doc URLs and live-search commands; read this whenever an option name or behavior is uncertain.