-
Notifications
You must be signed in to change notification settings - Fork 492
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
Support a root directory other than the repository's root #891
Comments
Would it work to put all your non-home directory stuff in a directory called |
Unfortunately not, many of the files that I'm referring to are supposed to stay in the repository root. Such as:
https://github.com/felipecrs/dotfiles/blob/master/.chezmoiignore |
This would also help newcomers from homeshick and homesick to migrate. :) |
I actually tried setting the |
This moves all files which are actually mapped to the home folder with chezmoi to a subfolder of the repository called home. This gives me peace of mind for adding more files to the repo without worrying about polluting my actual home folder. This way, things are much more organized. This also includes a migration script, so users who still are using the old TOML format for configuration, or have their chezmoi not pointing to the home subfolder will be prompted for fixing it by reinitializing chezmoi. The migration also handles the deletion of old configuration. Deleting the whole configuration is needed because of twpayne/chezmoi#1431. References twpayne/chezmoi#891
Ok, so I implemented your suggestion, @explorador at felipecrs/dotfiles#32. It's working so far. The only issue that I can think of is with |
Actually, there is a major issue with this approach: Every time I call Because of this, I implemented a workaround at felipecrs/dotfiles@e642eb9. |
Moving from #1423 (comment). @twpayne I can try to propose a PR to fix it but unfortunately not today, most likely tomorrow. Please don't wait for me if you are willing to try my suggestion, as it should be very simple anyway. |
With 2.5.0, #891 (comment) was fixed. 🎉 Another point that I noted, was that Some workarounds that I can think of:
|
@twpayne the only missing thing from my perspective is #891 (comment). |
Thanks, re-opening. |
This can now be done using the $ chezmoi init --working-tree=~/.local/share/chezmoi --source=~/.local/share/chezmoi/home 80efab9 added a test for this (search for Hopefully this is now all done - please reopen if needed. |
Cool, it indeed works: $ docker run --rm -it buildpack-deps:curl bash
$ bash <(curl -fsSL https://git.io/chezmoi) -- init --working-tree=~/.dotfiles --source=~/.dotfiles/home felipecrs Thank you very much! |
The problem
I use my dotfiles repository extensively, not only for dotfiles, but other things that relates to my machines management. Despite
chezmoi
supports ignoring files through the.chezmoiignore
, I would like to sort my repository by moving all my real dotfiles to a folder calledhome
in the repository (just likehomeshick
), so I would not need to manage the.chezmoiignore
anymore.Solution
A way to set the default root for the source dotfiles, other than the repository root. Probably a new key in the
.chezmoi.toml.tmpl
Alternatives
I though on setting
sourceFolder
to the sub-folder that I want, but I wonder if this won't break any otherchezmoi
functionality such aschezmoi update
since thesourceFolder
would not be the git root anymore.The text was updated successfully, but these errors were encountered: