Replies: 2 comments 2 replies
-
Does your actual chezmoi config file (e.g. Based on your example, it should appear there after you run And after your |
Beta Was this translation helpful? Give feedback.
-
I'm not sure if this is your problem, but you need to force variable creation with |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I'm a bit lost on how to accomplish something I know is possible with chezmoi, but I haven't seen a good 'how to' or 'recipe' driven guide for how to do this.
I have an existing chezmoi setup for two machines, and expanding it to more. I'd like to have chezmoi conditionally install some packages based on user input. For example, lets say I want to install jj only on some machines, and I just want to decide based on a prompt. I think that means that the desired end-state is one where I end with
chezmoi.toml
in my chezmoi config:so I add this to .chezmoi.toml.tmpl
I then change scripts or my Brewfile or whatever in chezmoi to use
{{ $installJJ }}
, but they all fail with themap has no entry for key
. My understanding is this is due to the order of when things get run ininit
.Am I doing this incorrectly? Is there a better way to handle this sort of 'optional user-driven' config? I've read thru https://www.chezmoi.io/user-guide/setup/#re-create-your-config-file and https://www.chezmoi.io/reference/special-files/chezmoidata-format/ and related docs, but I'm a bit lost at how to add this to an existing setup.
Beta Was this translation helpful? Give feedback.
All reactions