I use direnv with this .envrc on NixOS 26.05:
# shellcheck shell=bash
if ! has nix_direnv_version || ! nix_direnv_version 3.1.0; then
source_url "https://raw.githubusercontent.com/nix-community/nix-direnv/3.1.0/direnvrc" "sha256-yMJ2OVMzrFaDPn7q8nCBZFRYpL/f0RcHzhmw/i6btJM="
fi
use flake
source_env_if_exists .envrc.local
.envrc.local contains lines like:
export FOO_BAR="$(rbw get [REDACTED])"
When I run direnv allow for this directory and cd into it, rbw asks me for my vault password (using pinentry). After I enter it, the terminal freezes. Even Ctrl+C does not have any effect.
When I run rbw stop-agent in another terminal, the "direnv terminal" immediately unfreezes and returns to the shell prompt with output direnv: export [REDACTED]. The environment variables set in .envrc.local have non-empty values, i.e. rbw must have been able to retrieve the items from the vault.
Workaround: When I execute rbw-agent before entering the "direnv directory", rbw will also ask for the vault password, but the terminal will not freeze.
I use direnv with this
.envrcon NixOS 26.05:.envrc.localcontains lines like:When I run
direnv allowfor this directory andcdinto it,rbwasks me for my vault password (using pinentry). After I enter it, the terminal freezes. Even Ctrl+C does not have any effect.When I run
rbw stop-agentin another terminal, the "direnv terminal" immediately unfreezes and returns to the shell prompt with outputdirenv: export [REDACTED]. The environment variables set in.envrc.localhave non-empty values, i.e.rbwmust have been able to retrieve the items from the vault.Workaround: When I execute
rbw-agentbefore entering the "direnv directory",rbwwill also ask for the vault password, but the terminal will not freeze.