You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
No idea if this already is a feature of Chezmoi and I'm just too dumb/blind to figure this out. I currently am in the process of refactoring my dotfiles so that I can use them effortlessly at work, on private workstations, in headless/server environments aswell as minimalistic dev containers/environments. I do need quite a few work-specific scripts/env vars/convenience functions etc. at work, so I'd to separate these different environments.
I'd like to conditionally include the work folder alongside everything in root. The condition could e.g. be {{ if eq .machineType "work" }} {{ includeFolder "../work" }} {{ end }}.
Would it be possible to do something like this using Chezmoi or is this outside of its scope?
Describe alternatives you've considered
Alternatives I've considered would be an exhaustive .chezmoiignore inside the root folder covering all edge cases were I'd want folder XYZ but not folder ZYX. However, I fear the file could become too complex at some point.
Additional context
Got the idea from Nix's config management, which I used before Chezmoi, were I'd often import common and specific pre-defined configurations to a specific host/user.
The text was updated successfully, but these errors were encountered:
The point of chezmoi is to use a single source of truth and use templates and .chezmoiignore files to control what files are populated in each machine. If you have separate directories for "work" and "private" then you will run into problems when both need to change the same file. The solution is to use a template.
For modifying files outside of your home directory (i.e. for "root" in your example) there's a good description of how to do this here: #2574.
Is your feature request related to a problem? Please describe.
No idea if this already is a feature of Chezmoi and I'm just too dumb/blind to figure this out. I currently am in the process of refactoring my dotfiles so that I can use them effortlessly at work, on private workstations, in headless/server environments aswell as minimalistic dev containers/environments. I do need quite a few work-specific scripts/env vars/convenience functions etc. at work, so I'd to separate these different environments.
Describe the solution you'd like
Imagine the following layout:
I'd like to conditionally include the
work
folder alongside everything inroot
. The condition could e.g. be{{ if eq .machineType "work" }} {{ includeFolder "../work" }} {{ end }}
.Would it be possible to do something like this using Chezmoi or is this outside of its scope?
Describe alternatives you've considered
Alternatives I've considered would be an exhaustive
.chezmoiignore
inside theroot
folder covering all edge cases were I'd want folder XYZ but not folder ZYX. However, I fear the file could become too complex at some point.Additional context
Got the idea from Nix's config management, which I used before Chezmoi, were I'd often import common and specific pre-defined configurations to a specific host/user.
The text was updated successfully, but these errors were encountered: