twpayne/chezmoi

Apply .tmpl files in git repos declared in .chezmoiexternal

Closed this issue · 2 comments

Is your feature request related to a problem? Please describe.

I have my nvim dotfiles in a separate repo, and would like to use the go templating stuff from chezmoi on then
A clear and concise description of what the problem is, for example "I'm always
frustrated when...".
Certain nvim plugins require an absolute path in json - no way for me to have platform specific files without any scripts running on these files.

Describe the solution you'd like

chezmoi init -r could expand .tmpl files in external repos
A clear and concise description of what you want to happen.
chezmoi init -r could expand .tmpl files in external repos

Describe alternatives you've considered

Copy and pasting my nvim files into my chezmoi repo, but unable to merge in changes using git from the base repo that I forked my nvim config.
A clear and concise description of any alternative solutions or features you've
considered.
Cant think of one

Additional context

Add any other context or screenshots about the feature request here.

When you use a git-repo external you delegate management of that subdirectory to git, and chezmoi's involvement is limited to running git clone on init and git pull --rebase on apply. You cannot use chezmoi templates in a git-repo external.

Depending on the exact details of your case, you can use a run_after_ script to overwrite the JSON configuration files. However, I would instead raise an issue with the software that requires absolute paths in its configuration file.

I think I'll just move my nvim files back to my chezmoi repo since it'll be less hassle, and then just periodically copy them out and merge in changes separately when I need to