Managing multiple configuration profiles #2976
-
I've been considering several alternatives to manage my dotfiles, and chezmoi seems to be the most stable and efficient. However, I've seen that dotdrop supports multiple configuration profiles, does chezmoi have a similar feature? Thank you |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 3 replies
-
What exactly do you mean by a configuration profile? chezmoi supports infinite configuration profiles though configuration variables in its configuration file. |
Beta Was this translation helpful? Give feedback.
-
chezmoi does not have the concept of "configuration profile" the way that dotdrop does, but it can make similar choices through the use of configuration variables and/or machine state (such as the OS name or even the presence of certain files). dotdrop configuration is highly manual and indirect and requires specifying a managed dotfile at least twice (once for the initial "reference" definition, and once for each configuration profile to specify which references to use). I’ve only skimmed the README, but this should show what is required: config:
backup: true
banner: true
create: true
dotpath: dotfiles
ignoreempty: false
keepdot: false
longkey: false
showdiff: false
workdir: ~/.config/dotdrop
dotfiles:
d_polybar:
dst: ~/.config/polybar
src: config/polybar
f_vimrc:
dst: ~/.vimrc
src: vimrc
f_xinitrc:
dst: ~/.xinitrc
src: xinitrc
profiles:
home:
dotfiles:
- f_vimrc
- f_xinitrc
- d_polybar
office:
dotfiles:
- f_xinitrc
- d_polybar You have to define the In chezmoi, you would add one configuration variable to your [data]
location = "home" # or "office" And then you would create a
Now There is light discussion of adding a configuration mapping file for v3 to make certain things easier (a number of programs which store their configuration in All of this to say that @twpayne is right when he says "chezmoi supports infinite configuration profiles though configuration variables in its configuration file". |
Beta Was this translation helpful? Give feedback.
chezmoi does not have the concept of "configuration profile" the way that dotdrop does, but it can make similar choices through the use of configuration variables and/or machine state (such as the OS name or even the presence of certain files).
dotdrop configuration is highly manual and indirect and requires specifying a managed dotfile at least twice (once for the initial "reference" definition, and once for each configuration profile to specify which references to use). I’ve only skimmed the README, but this should show what is required: