-
Notifications
You must be signed in to change notification settings - Fork 500
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chezmoi doctor reports config-file as failed if chezmoi is an alias #4181
Comments
Have you tried running doctor directly? chezmoi \
--config "$HOME/.second/config/che.yaml" \
--cache "$HOME/.second/cache" \
--destination "$HOME"
--persistent-state "$HOME/config/chestate.boltdb"
--source "$HOME/.second/source" doctor |
Thanks for reporting this. This has nothing do with the alias, but is instead due to the |
Yes, this is not a problem with the alias indeed. I ran the command as halostatue suggested and I confirm I have the same behaviour. I saw the changes you did in #1482. Although there are many of them, it looks like the --config flag works, only the reporting by More generally, is it possible (supported?) to run two chezmoi stacks on the same machine? If yes, is an alias the preferred solution? Many thanks for looking into this. |
FWIW, the other commands I could find that report the config file location are not faulty: $ che data | grep configFile:
configFile: /home/unix/.second/config/che.yaml $ che cd
$ echo $CHEZMOI_CONFIG_FILE
/home/unix/.second/config/che.yaml |
#4182 should make There are corner cases related to #3127, #3486, and #3489 that I need to check before #4182 is merged.
It's possible and supported within reason, but if you're running two chezmoi stacks then you're holding chezmoi wrong and will likely run into problems. See this FAQ entry: https://www.chezmoi.io/user-guide/frequently-asked-questions/design/#can-chezmoi-support-multiple-sources-or-multiple-source-states |
Hi, Thank you for getting back to me. Somehow, I missed the FAQ entry you mentioned, so my question may have seemed a bit dumb. I apologize for that. I completely understand your "supported within reason" caveat, and it makes total sense to me. For context: I have dozens of servers, VPSes, and LXC containers. On each of these (often ephemeral, throwaway) machines, I run "normal" chezmoi with default source, destination, config, etc., to install my base dotfiles (essentially ~/.vim*, ~/.bash*, and the like). Then, I have a couple of machines to remotely access this armada. On these machines, I install things like ~/.ssh, ~/.gnupg, etc. For this, I use my che alias by sourcing this script: alias che='chezmoi --config "~/.second/config/che.yaml" --cache "~/.second/cache" --destination "${HOME}" --persistent-state "~/.second/config/chestate.boltdb" --source "~/.second/source"'
type __start_chezmoi > /dev/null 2>&1 && complete -o default -o nospace -F __start_chezmoi che To me, it doesn't make sense to deploy all my SSH and GPG keys everywhere, even if there are passphrase-protected, even if they are also encrypted. Moreover, they are stored on a different, private git server whereas my "normal" chezmoi stuff is public on github. That said, I take great care to ensure that there is absolutely no crossover between the files managed by chezmoi et the ones managed by che. |
For this, personally I store all my secrets in my password manager. On my ephemeral, throwaway machines I don't install my password manager and I use This way I have a single dotfiles repo which is public on GitHub, does not contain any secrets (not even encrypted), can be deployed to ephemeral machines, and I only need to install my password manager on machines that require secrets. |
Describe the bug
I have set up an alias to run chezmoi in a non-default location.
When I run the
doctor
command, the config-file is reported asfailed
.To reproduce
che
as follows:doctor
command:Please note that both config files exist:
$ chezmoi cat-config data: workstation: false $ che cat-config format: yaml
The
chezmoi
(unaliased) command is fine:Expected behavior
I would expect the output of the alias to be similar as without the alias, i.e.:
Output of command with the
--verbose
flagOutput of
chezmoi doctor
Additional context
Apart from this minor issue, it looks like the alias works well. It is very handy as it allows me to have two different sources for different purposes.
The text was updated successfully, but these errors were encountered: