Hacker News new | ask | show | jobs
by twp 2715 days ago
Yes, you can define your own template variables in the config file, for example if you include:

  data:
    category: "linux-server"
in your .config/chezmoi/chezmoi.yaml file, you can then use it in your templates and a .chezmoiignore file (which is also treated as a template). A .chezmoiignore file could look like:

  {{ if eq .category "linux-server" -}}
  .windowmanager.conf
  {{ end -}}
I use this technique myself: https://github.com/twpayne/dotfiles/blob/master/.chezmoiigno...
1 comments

Thanks! Just defining it as a config variable is far too obvious in hindsight, I don't know why it didn't cross my mind.

I'll definitely try it out!