Is your feature request related to a problem? Please describe.
I'd like to use variables in dotter's config files themselves. Something like:
[variables]
config_dir = "~/.config"
[shell.files]
"zsh/zprofile" = "~/.zprofile"
"zsh/zshrc" = "{{config_dir}}/zsh/zshrc"
"gitconfig" = "{{config_dir}}/git/config"
and then in ~/.zprofile too:
XDG_CONFIG_HOME="{{config_dir}}"
Describe the solution you'd like
Maybe parse the variables first, then render a handlebars template for each path. Or is that overkill?
Alternatively, maybe new values can be added to shellexpand, to be substituted like env vars ($config_dir/zsh/zshrc). Might need changes upstream. I think shellexpand::env_with_context could be used for this.
Describe alternatives you've considered
Run dotter with variables set on the shell for shellexpand to use:
env XDG_CONFIG_HOME="~/.config" dotter deploy
Is your feature request related to a problem? Please describe.
I'd like to use variables in dotter's config files themselves. Something like:
and then in
~/.zprofiletoo:XDG_CONFIG_HOME="{{config_dir}}"Describe the solution you'd like
Maybe parse the variables first, then render a handlebars template for each path. Or is that overkill?
Alternatively, maybe new values can be added to
shellexpand, to be substituted like env vars ($config_dir/zsh/zshrc).Might need changes upstream.I thinkshellexpand::env_with_contextcould be used for this.Describe alternatives you've considered
Run dotter with variables set on the shell for
shellexpandto use:env XDG_CONFIG_HOME="~/.config" dotter deploy