twpayne / chezmoi

Manage your dotfiles across multiple diverse machines, securely.

Home Page:https://www.chezmoi.io/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Using environment variable in onepasswordRead

chessbyte opened this issue · comments

What exactly are you trying to do?

In a template, trying to specify 1password account from an environment variable.

What have you tried so far?

This works
{{ onepasswordRead "op://chessbyte/GitHub/access-token" "1234567890ABCDEF1234567890" }}

but this doesn't
{{ onepasswordRead "op://chessbyte/GitHub/access-token" "$OP_ACCOUNT" }}

nor does this
{{ onepasswordRead "op://chessbyte/GitHub/access-token" "{{ env "OP_ACCOUNT" }}" }}

Where else have you checked for solutions?

Output of any commands you've tried with --verbose flag

Output of chezmoi doctor

Additional context

You want this:

{{ onepasswordRead "op://chessbyte/GitHub/access-token" (env "OP_ACCOUNT") }}

Hopefully this is now resolved. Please re-open if needed.