direnv

Installs direnv, an environment switcher for the shell, with /workspaces automatically whitelisted.

Current version: 0.1.0 | direnv.net

Usage

"features": {
  "ghcr.io/devopsbuildingblocks/devcontainer-features/direnv:0": {}
}

With options:

"ghcr.io/devopsbuildingblocks/devcontainer-features/direnv:0": {
  "version": "2.35.0"
}

Options

OptionTypeDefaultDescription
versionstringlatestdirenv version to install

What’s included

  • direnv installed via devbox global add
  • ~/.config/direnv/config.toml created for both root and the remote user, whitelisting /workspaces
  • zsh shell hook configured automatically via ~/.shellrc.d/

/workspaces whitelist

On container creation, the feature writes the following config for each user:

[whitelist]
prefix = ["/workspaces"]

This means any .envrc file inside /workspaces is trusted automatically โ€” no manual direnv allow required after a rebuild.