Is your feature request related to a problem? Please describe.
I am using Arch Linux with Niri on my desktop and Void Linux with Xmonad on my laptop.
Due to the difference in display management system (X11 vs. Wayland), I have many dotfiles specific for each system, but I still have a ton of dotfiles shared across all systems.
For example, I use different application launcher and notification daemon on my desktop and laptop, but I still use Bash, Fish, Vim, Emacs, Ghostty, wallpapers, Git settings, templates, etc...
Reconciling for the difference is possible now, but it requires carefully reading and making sure that .chezmoiignore is correct in all cases. It is working for now, but the difference would just keep getting larger as I move away from my X11-based locker setup on my desktop, and I'd be banging my head against the .chezmoiignore file after finding 1852nd typo that breaks the system.
Describe the solution you'd like
Maybe we can put multiple roots in .chezmoiroot and make the file a template. For example,
common
{{- if eq .chezmoi.hostname "my-desktop" }}
desktop
{{- else if eq .chezmoi.hostname "my-laptop" }}
laptop
{{- else }}
# Maybe this is a server that needs no GUI-related stuff :)
{{- end }}
If there are any conflicts between among dotfiles, the ones specified later in .chezmoiroot always preferred, including the directories with +exact attributes.
Describe alternatives you've considered
Putting everything in .chezmoiignore is for now the only solution, I imagine.
Additional context
My dotfile repository is here. I recently moved to Chezmoi from GNU Stow-based approach, and this is the feature I'm missing the most from Stow.
I've seen a discussion at #3083, but it seems to refer to a system where completely different operating system is used. I thought this issue was different enough to deserve its own feature request.
Is your feature request related to a problem? Please describe.
I am using Arch Linux with Niri on my desktop and Void Linux with Xmonad on my laptop.
Due to the difference in display management system (X11 vs. Wayland), I have many dotfiles specific for each system, but I still have a ton of dotfiles shared across all systems.
For example, I use different application launcher and notification daemon on my desktop and laptop, but I still use Bash, Fish, Vim, Emacs, Ghostty, wallpapers, Git settings, templates, etc...
Reconciling for the difference is possible now, but it requires carefully reading and making sure that
.chezmoiignoreis correct in all cases. It is working for now, but the difference would just keep getting larger as I move away from my X11-based locker setup on my desktop, and I'd be banging my head against the.chezmoiignorefile after finding 1852nd typo that breaks the system.Describe the solution you'd like
Maybe we can put multiple roots in
.chezmoirootand make the file a template. For example,common {{- if eq .chezmoi.hostname "my-desktop" }} desktop {{- else if eq .chezmoi.hostname "my-laptop" }} laptop {{- else }} # Maybe this is a server that needs no GUI-related stuff :) {{- end }}If there are any conflicts between among dotfiles, the ones specified later in
.chezmoirootalways preferred, including the directories with+exactattributes.Describe alternatives you've considered
Putting everything in
.chezmoiignoreis for now the only solution, I imagine.Additional context
My dotfile repository is here. I recently moved to Chezmoi from GNU Stow-based approach, and this is the feature I'm missing the most from Stow.
I've seen a discussion at #3083, but it seems to refer to a system where completely different operating system is used. I thought this issue was different enough to deserve its own feature request.