-
Notifications
You must be signed in to change notification settings - Fork 472
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
Allow two chezmoi
instances to run in parallel when they run as a different user
#1516
Comments
Also, to make this solution even better, it would be awesome if some additional template variables existed, so I could call chezmoi like so:
So that if I called |
@twpayne an option would be to expose the persistent file location as a CLI option, so that users can tweak it as needed too. I would for example do: sudo path/to/chezmoi --config $HOME/.config/chezmoi/root.chezmoi.yaml --persist $HOME/.config/chezmoi/root.chezmoi.boltdb What do you think? |
Another would option be to automatically infer the persistent file's name from the config file name. For example: chezmoi.yaml -> chezmoi.boltdb But: root.chezmoi.yaml -> root.chezmoi.boltdb |
Thank you for the discussion earlier today. #1604 is an attempt to fix this using your suggestion for a |
Is your feature request related to a problem? Please describe.
I'm experimenting with
chezmoi
to manage my root dir, as otherwise I have to basically rewrite a lot of the functionalities that chezmoi provides out-of-the-box in myrun_
scripts.My goal is to have 2 different sourceDir's, one with my normal home dir, and another with the "/" destination dir in mind. Then, as a
run_always_after
script in my home source, I want to runchezmoi
as root to apply the changes of the root source dir.POC: felipecrs/dotfiles#44
Describe the solution you'd like
I believe that multiple instances of
chezmoi
should be able to run in parallel as long as they are running by different users. In my case, the first user will be myself while the second will beroot
.But I also think that on shared computers, nothing prevents multiple users to manage their dotfiles with chezmoi, and then they could hit this limitation if both runs in parallel by any chance.
Describe alternatives you've considered
Instead of adding the
sudo chezmoi
call to myrun_always_
script, I could call it manually once thechezmoi apply
for my home dir finishes. But it's a very not desirable solution for me. :)Even so, it would not fix the possible 2 users in a shared computer issue that I stated.
Additional context
Well, I know chezmoi's goal is not to manage folders other than the home, but regardless, probably everyone's dotfiles has at least one script to install something by running as root (
sudo apt install zsh
) for example.And I'm just experimenting... perhaps what I'm trying to do is not a good alternative anyway.
The text was updated successfully, but these errors were encountered: