-
I'm looking for recommendations on how to manage my Right now, I'm using a simple script to periodically copy some directories and files from Is there a "better" way that I can manage them, preferably without executing chezmoi as the root user or changing permission of |
Beta Was this translation helpful? Give feedback.
Replies: 6 comments 11 replies
-
I think that running as root would be a need, otherwise how could chezmoi write to /etc? In my dotfiles, I currently configure the files under It may not be the cleanest approach, neither the most performant and bullet proof, but it works for me. |
Beta Was this translation helpful? Give feedback.
-
This is straying into the territory of managing files outside your home directory - which is an explicit non-goal for chezmoi. You might be better off with Ansible/Chef/Puppet/Salt. |
Beta Was this translation helpful? Give feedback.
-
@ayushnix You can take a look on my branch friends, where I manage install profiles and run_once scripts if a certain file changes: |
Beta Was this translation helpful? Give feedback.
-
Marked as answer link doesn't exist anymore :( Updated link from @felipecrs dotfiles: run_once_before_1_setup_apt_packages.sh.tmpl#L68-L74 |
Beta Was this translation helpful? Give feedback.
-
There's a great tool to manage /etc, etckeeper |
Beta Was this translation helpful? Give feedback.
-
I know it's not recommended as it put security at risk, but I managed to create such chezmoi config. If you don't care about security - my alias from alias schezmoi="sudo chezmoi --destination /etc --source /etc/chezmoi/data --working-tree /etc/chezmoi/data --config /etc/chezmoi/chezmoi.toml" then but once again be aware of security risks e.g. here simple marcin@pc:~$ schezmoi status
[sudo] password for marcin:
M root/.bashrc
marcin@pc:~$ schezmoi cd
root@pc:/etc/chezmoi/data# whoami
root
root@pc:/etc/chezmoi/data# ouch! you have been warned ;) |
Beta Was this translation helpful? Give feedback.
I think that running as root would be a need, otherwise how could chezmoi write to /etc? In my dotfiles, I currently configure the files under
/etc
withsudo
inside of myrun_
scripts. An example:https://github.com/felipecrs/dotfiles/blob/master/home/run_once_before_1_setup_apt_packages.sh.tmpl#L68-L74
It may not be the cleanest approach, neither the most performant and bullet proof, but it works for me.