Skip to content

Encrypt template? #3713

Closed Answered by twpayne
mauvehed asked this question in Q&A
Apr 23, 2024 · 4 comments · 1 reply
Discussion options

You must be logged in to vote

The easy way to do this is to use the decrypt template function, something like:

{{ join .chezmoi.sourceDir ".encrypted-data.txt" | include | decrypt }}

Where .encrypted-data.txt is the file containing the encrypted data. The leading . makes chezmoi ignore it. You can create it with:

$ chezmoi encrypt -o $(chezmoi source-path)/.encrypted-data.txt unencrypted-data.txt

Replies: 4 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Answer selected by mauvehed
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@halostatue
Comment options

Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants