DevEnv with Nix
Last updated
Last updated
devenv is a tool for creating reproducible, declarative development environments using Nix. It is ideal for teams and projects that want consistent tooling, easy onboarding, and secure secret management.
Reproducibility: Every developer gets the same environment, on any OS (Linux, macOS, WSL).
Isolation: No more global tool pollution—everything is project-scoped.
Automation: Integrates with CI/CD for consistent builds and tests.
Secrets Management: Supports for encrypted secrets in Git.
Easy Onboarding: devenv up
and you’re ready to code.
devenv.nix
main.tf
Add to your environment (Nix shell, devenv, or devbox):
Or install globally:
For each user or host that should decrypt secrets:
Add the public key(s) to your project, e.g. in secrets/age.pub
.
age.secrets
fileList all public keys that should have access:
Encrypt a file for the listed recipients:
The resulting .age
file can be committed to Git.
In your devenv.nix
:
When you run nix develop
or devenv up
, agenix will decrypt the secret and set the environment variable.
Only users with the corresponding private key can decrypt the secret.
To rotate or add users, update age.secrets
and re-encrypt.
Encrypt your AWS credentials:
Only users with the right SSH keys can decrypt.
With devenv and Nix, you get reproducible, secure, and portable dev environments for any stack.
is a Nix-native tool for managing encrypted secrets using age. It allows you to store secrets in your Git repository, encrypted for specific users or hosts, and decrypt them only when needed in your Nix or devenv environment.