Replies: 4 comments 3 replies
-
chezmoi already has multiple mechanisms for keeping data secret: you can use a password manager or encryption. |
Beta Was this translation helpful? Give feedback.
-
Three correct answers: The short answer is that chezmoi does not support this workflow as described and it can't, since its state is centred around final resolution of a file. The medium answer is you can do something like this using chezmoi but you can't do it in chezmoi. You can execute any template with The long answer is to better understand what you're trying to solve. If you're committing these files into git repos, you should probably look at using better solutions like sopts or 1Password CLI execution, etc. Chezmoi is the wrong tool for what you're doing as it's for managing dotfiles, not managing secrets. The 1Password CLI includes native template support and there are similar tools for most secret management mechanisms. |
Beta Was this translation helpful? Give feedback.
-
For posterity, I found gomplate to be just what I was looking for, although tools like jinja-cli would've also worked for this use case. I can create a script to process the templates I create when I clone a repo and (obviously) never upload the data source file for these templates. |
Beta Was this translation helpful? Give feedback.
-
@ayushnix what you are describing sounds similar to my Layered Solution - read: #2574 |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I'm not sure if this workflow is supported by chezmoi.
I want to manage files in a specific directory using chezmoi, add them in a specific source path, and apply them to a specific path without the directory prefixes.
For example, if the destination directory is
~/data/config/repo-name/
and I runchezmoi -S ../../repo/repo-name/ add README.md
, I wantREADME.md
to be present in the source directory, not~/data/config/repo-name/README.md
. Similarly, if I addsample-dir/app.ini
, I want the same hierarchy to get checked in the source directory. Then, when I want to apply the source directory, I want to do it somewhere else besides the original destination directory.Is this something I should/can do with chezmoi?
My primary intent here is to leverage go templates to hide secrets from files I want to check in git repositories.
Beta Was this translation helpful? Give feedback.
All reactions