What is devenv?
devenv is a developer environment tool that leverages Nix to create fast, declarative, reproducible, and composable environments. It enables developers to define their development environment using a simple JSON-like language, with features like environment variables, packages, shell initialization, and automatic activation via direnv. The tool supports over 50 programming languages, including Python, Rust, Go, PHP, and Ruby, with built-in tooling like LSP servers, formatters, linters, and compilers.
devenv offers instant environments with caching, achieving activation in under 100ms through precise Nix evaluation caching and smart invalidation. It includes task automation, git hooks, process management, and services like PostgreSQL, Redis, and MySQL. The tool supports container interoperability, allowing generation and running of containers from development environments. It also provides profiles for selective activation, ad-hoc environments for quick experiments, and secrets management with SecretSpec for declarative secrets.
Features
- Instant Environments with Caching: Achieve environment activation in under 100ms using precise Nix evaluation caching and smart invalidation
- Zero Configuration: Works out of the box with no setup required, no daemons, and no manual file watching
- Language Support: Supports over 50 programming languages with built-in tooling, version support, and common utilities
- Task Automation: Define tasks and git hooks to automate development workflows with dependency management
- Process Management: Run declarative processes with tools like process-compose for logs and restart capabilities
- Container Interoperability: Generate and run containers from development environments for shell and processes
- Profiles: Organize environments with profiles for selective activation based on workflows, hostname, or username
- Secrets Management: Manage secrets declaratively using SecretSpec with support for Keychain, 1Password, and environment variables
Use Cases
- Setting up reproducible development environments for software projects
- Automating development workflows with tasks and git hooks
- Managing multiple programming language environments in monorepos or polyrepos
- Running services like databases and caches locally for development
- Creating ad-hoc environments for quick experiments or CI/CD testing
- Containerizing development environments for consistency across platforms
- Enforcing team standards and best practices through shared configurations
- Testing applications across different language versions or configurations
FAQs
-
What programming languages does devenv support?
devenv supports over 50 programming languages, including Python, Rust, Go, PHP, Ruby, JavaScript, Java, and many others, with built-in tooling like LSP servers, formatters, and linters. -
How does devenv achieve fast environment activation?
devenv uses precise Nix evaluation caching to activate environments in under 100ms, with smart invalidation that automatically detects file changes and re-evaluates only what's necessary. -
Can I use devenv for containerized development?
Yes, devenv supports container interoperability, allowing you to generate containers from your development environment and run them for shell access or processes. -
Does devenv support task automation?
Yes, devenv allows you to define tasks and git hooks to automate development workflows, with dependency management and parallel execution. -
How can I manage secrets with devenv?
devenv provides secrets management using SecretSpec, enabling declarative secrets that can be retrieved from system Keychain, 1Password, LastPass, dotenv, or environment variables at runtime.