Managing etc files with chezmoi using hooks #3521
dgudim
started this conversation in
Show and tell
Replies: 1 comment
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
For some time, I have been managing some of my etc files with chezmoi. (Yeah, ik, this is not the intended usecase, but it works nicely)
How? Simple, it it's possible because of the new hooks! (
pre-apply
,post-update
, etc)All you need is this:
Post-update/apply hook
Pre-update/apply hook
Pre-add hook
How it works:
dot_config/etc_mirror
) from/etc
to the.config/etc_mirror
directory in home.config/etc_mirror
modified by chezmoi back to/etc
Bonus!: With the pre-add hook, executing
chezmoi add /etc/<some file>
actually works!Limitations: The permissions are not recorded anywhere, so the script only works for files with
644
permissions (which most of the files have anyway)Beta Was this translation helpful? Give feedback.
All reactions