-
Notifications
You must be signed in to change notification settings - Fork 532
.chezmoiinittemplates
#4314
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Does this complex logic really have to live in the init template? |
I’m not sure I understand the question. I recently completed this and started using it yesterday, but it's a refactoring of something I was managing poorly manually. A lot of this was enabled by the addition of I’m now having to configure things very differently than my last job to where the work computer doesn't have a lot of software that I use at home, and my home computer doesn't have some of the software on the work computer. There's the work that I did for git identities (to keep git identity configuration out of the main configuration file and using include templates that involve parsing 1Password documents from YAML, etc.). But the initial setup is always a little hard, so I’ve decided to sort on available 1Password document tags for some features, as well as being able to configure the map of 1Password accounts that are in use. This particular piece works so that if you add a new 1Password account to |
Wow, that's a really sophisticated and impressive setup! I would like to keep the config file template generation mechanism simple, if possible. This is why I'm pushing back on the As an alternative, what do you think about making the config file generation mechanism pluggable? i.e. instead of chezmoi executing the Thoughts? |
chezmoi provides so many useful tools (like At the same time…that sort of pluggability would let me skip some of the inanities forced by using text/template as a full programming language. I don't know that I’d want to develop everything that I would be missing, and my setup works, but because I can't use I don't think that there's a good answer for this, because |
Is your feature request related to a problem? Please describe.
Describe the solution you'd like
I'm working on some complex feature requests that will make my
.chezmoi.toml.tmpl
much harder to read, so I was going to put these fragments in.chezmoitemplates
, but the presence ofpromptChoice
or any of the other prompt functions makes these unable to be moved.It would be useful to be able to have reusable templates for init-mode when adding complex logic like this (yes, it works;
1p/accounts/list
isn't yet visible on my site, but it basically returnsop accounts list --format json
):Describe alternatives you've considered
Putting the templates at the top of my
.chezmoi.toml.tmpl
.The text was updated successfully, but these errors were encountered: