Migrate from nix-shell to devenv or create new devenv projects. Use when users mention converting shell.nix/default.nix to devenv, setting up devenv environments, or need help with devenv configuration for languages (Python, Elm, Node, etc), services (PostgreSQL, Redis, MySQL), or processes.
Convert nix-shell projects to devenv or create new devenv environments with declarative configuration for languages, services, and processes.
Official devenv.nix Options Reference: https://github.com/cachix/devenv/blob/main/docs/src/reference/options.md
devenv is a declarative development environment tool built on Nix that provides:
devenv.nix replaces multiple configuration filesTrigger this skill when users:
# Install devenv
nix profile install nixpkgs#devenv
# Initialize in project directory
cd your-project
devenv init
# Enter environment
devenv shell
# Start services and processes
devenv up
See Migration Guide for detailed conversion patterns.
Quick conversion:
devenv shell and devenv up{ pkgs, ... }:
{
# Tools and utilities
packages = [ pkgs.git pkgs.jq ];
# Language runtimes
languages.python.enable = true;
languages.javascript.enable = true;
# Managed services
services.postgres.enable = true;
services.redis.enable = true;
# Long-running processes
processes.backend.exec = "uvicorn app:app --reload";
# One-time tasks
scripts.test.exec = "pytest";
# Git hooks (171 built-in hooks available)
git-hooks.hooks = {
ruff-format.enable = true;
prettier.enable = true;
};
# Environment variables
env.DATABASE_URL = "postgresql:///mydb?host=$PGHOST";
# Shell initialization
enterShell = ''
echo "Environment ready!"
'';
}
| nix-shell | devenv |
|---|---|
buildInputs | packages + languages.* |
shellHook | enterShell |
| Manual service setup | services.* (auto-managed) |
| process-compose.yml | processes |
| Makefile tasks | scripts |
| .pre-commit-config.yaml | git-hooks.hooks.* (170+ built-in) |
devenv.nix Options - Common configuration patterns and official options reference
By Topic:
Migration Guide - Converting from nix-shell to devenv
Language Configurations - Language-specific setup
Services Guide - Database and service configuration
Processes and Tasks - Process orchestration
Git Hooks Guide - Pre-commit integration
Advanced Patterns - Production patterns
Troubleshooting - Common issues and solutions
Ready-to-use devenv configurations:
User has: shell.nix or default.nix with buildInputs
Steps:
devenv shellUser wants: Python + PostgreSQL + Redis
Steps:
User wants: Backend + Frontend + services
Steps:
User wants: Add PostgreSQL to existing devenv.nix
Steps:
devenv upUser wants: Pre-commit hooks for code quality
Steps:
git-hooks.hooks.* to devenv.nixdevenv shell --command "pre-commit run --all-files"User has: Errors or unexpected behavior
Steps:
.devenv/state/devenv shell -vvvFor migrations:
search_packages to find devenv equivalents for nix packagesFor new projects:
search_packages to verify package availabilitysearch_options to discover configuration optionsdevenv shell, devenv up)Official Documentation:
For latest features and live documentation:
/cachix/devenvThis skill automatically configures the devenv MCP server (https://mcp.devenv.sh/) for real-time access to devenv documentation.
The MCP server is packaged with this skill - no additional setup required. Two MCP tools are automatically available:
search_packages - Search available packages in devenv
packages = [ ] configurationsearch_options - Search available configuration options
When to use these tools:
When users need the most current information or have questions not covered in the references, use these MCP tools to query the server for authoritative, up-to-date answers.
Scenario 1: User asks "How do I add Python 3.12?"
search_packages with query "python 3.12"languages.python.enable = true;Scenario 2: User migrating from nix-shell with buildInputs = [ pkgs.redis pkgs.postgresql ]
search_packages to verify "redis" availabilitysearch_options to find service configuration optionsservices.redis.enable = true; services.postgres.enable = true;Scenario 3: User asks "Can I configure PostgreSQL port?"
search_options with query "postgres port"services.postgres.port)Scenario 4: User wants to add a specific tool like "ripgrep"
search_packages with query "ripgrep"packages = [ pkgs.ripgrep ];Common Commands:
devenv init # Initialize new project
devenv shell # Enter environment
devenv up # Start all processes
devenv up -d # Start in background
devenv shell <script> # Run script
devenv info # Show config
devenv shell -vvv # Debug mode
This skill provides:
Workflow: