Skip to content

Files and variables

Files

devenv.nix

The only required file for specifying the developer environment.

Generated by devenv init and thoroughly documented, starting with the basics.

devenv.local.nix

Same as devenv.nix, but not meant to be committed into the Git repository so that developers can override some things for their local use case.

devenv.yaml

Configuration for inputs and imports, allowing you to specify dependencies and how to compose them.

devenv.lock

Pinned inputs, making sure your developer environment is reproducible.

.envrc

direnv integration logic, auto-generated using devenv init.

See automatic shell activation to set up your shell to automatically activate the developer environment when you cd into it.

Environment Variables

$DEVENV_ROOT

Points to the root of the project where devenv.nix is located.

$DEVENV_DOTFILE

Points to $DEVENV_ROOT/.devenv.

$DEVENV_STATE

Points to $DEVENV_DOTFILE/state.

$DEVENV_RUNTIME

Points to a temporary directory with a path that's unique to each $DEVENV_ROOT. It's used for storing sockets and other runtime files. Defaults to $XDG_RUNTIME_DIR and falls back to $TMPDIR and finally /tmp.

$DEVENV_PROFILE

Points to the Nix store path that has final profile of packages/scripts provided by devenv.

Useful for teaching other programs about /bin, /etc, /var folders.