4 ms·
With chezmoi you can use pass to store secrets in your dotfiles, for example if you want to set a secret API token in your ~/.bashrc you can use: export SECR
by twp 5y ago
With chezmoi you can use pass to store secrets in your dotfiles, for example if you want to set a secret API token in your ~/.bashrc you can use:
export SECRET_API_TOKEN={{ pass "api/token" | quote }}
For more info see https://github.com/twpayne/chezmoi/blob/master/docs/HOWTO.md#use-pass https://github.com/twpayne/chezmoi/blob/master/docs/HOWTO.md... and https://github.com/twpayne/chezmoi/blob/master/README.md https://github.com/twpayne/chezmoi/blob/master/README.md.
- cycomanic 5y agoYou could also use secret-tool for this, which is compatible with many tools that support the secret tool, I use keepassxc for example.
- ryanianian 5y agoWhat is the `quote` command that example pipes to? Seems handy but unsurprisingly hard to search for.
- iudqnolq 5y agoI think it's this? I found it by googling "shell quote command". https://askubuntu.com/questions/354915/quote-command-in-the-shell https://askubuntu.com/questions/354915/quote-command-in-the-...
- virchau13 5y agoAlso note that `printf "%q"` is an alternative to this.
- twp 5y agoIn this example, `quote` is a function from sprig [1] which chemzoi uses with Go's text/template language [2]. [1] https://masterminds.github.io/sprig/strings.html https://masterminds.github.io/sprig/strings.html [2] https://pkg.go.dev/text/template https://pkg.go.dev/text/template