Skip to main content
Don’t put project deps in your system PATH. Don’t put system deps in your project flake.
Language: Nix  ·  Status: active  ·  Last active: this week  ·  Source on GitHub
nix-devenv is a library of dev shells. Every project repo in the portfolio pulls its flake.nix from here. One source of truth for what “the OpenTofu dev shell” or “the ML dev shell” contains.

What it does

  • Exports per-system devShells; the OpenTofu shell is tofu in flake.nix
  • Provides a mkshell template: nix flake init -t "github:dryvist/nix-devenv?ref=vN#mkshell", where vN is the current major tag
  • Pins toolchain versions so every project on the same shell gets the same tofu / terraform / kubectl / ansible
  • Activated per-project via direnv (.envrc is committed; .direnv/ is gitignored)
The Ansible shell sets DOCKER_HOST to the OrbStack socket when the variable is unset. Its shell definition owns this default.

How it fits

Anything project-scoped belongs here. Anything machine-scoped belongs in nix-darwin or nix-home.

Getting started

1

Scaffold a flake in your project

cd my-project && nix flake init -t "github:dryvist/nix-devenv?ref=vN#mkshell". Edit flake.nix to pick the shell you need.
2

Commit .envrc

Add use flake to .envrc. Commit it; direnv activates the shell whenever you cd in.
3

Pull a pre-built shell

Skip the local flake and nix develop "github:dryvist/nix-devenv?dir=shells/<lang>&ref=vN" for one-off work.

nix-darwin

The system layer. Tools belong there if every shell needs them.

nix-home

The user layer. Tools belong there if every project needs them but the system doesn’t.

nix-ai

AI-specific dev shell module: composes with this repo’s templates.

Source on GitHub

Templates, shells, full README.