Closed cregev closed 1 year ago
full_name
and tweak_mac
don't appear in your chezmoi data. I don't think they are being initialized because I don't think underscores are supported in variable names.
https://www.chezmoi.io/reference/templates/variables:
Variable names must consist of a letter and be followed by zero or more letters and/or digits.
The documentation should be updated, because _
are considered "letters":
❯ chezmoi execute-template '{{ $_x := .chezmoi.arch }}{{ $_x }}'
arm64
.chezmoi.yaml.tmpl
is used to generate ~/.config/chezmoi/chezmoi.yaml
and is not itself run during apply
, only during init
. So if the hardcoded values aren’t in ~/.config/chezmoi/chezmoi.yaml
, the error (that the data does not contain .full_name
) is correct.
I think @halostatue has spotted the problem.
You have a config file template, but you don't have a config file. To generate the config file, run:
$ chezmoi init
Hopefully your question has been answered. Please re-open if needed.
What exactly are you trying to do?
I am running Chezmoi and I am trying to get variables from
promptString
into data in order to be able to use them in all other templates with*.tmpl
file.~ chezmoi data
What have you tried so far?
First, I have tried to pass only 2 variables in my file
.chezmoi.yaml.tmpl
:When I have the following template
private_config.tmpl
:The output of the following command:
Where else have you checked for solutions?
I have hard coded 2 values
.chezmoi.yaml.tmpl
:When I have the following template
private_config.tmpl
:Output:
Output of
chezmoi doctor