External files that require multiple extraction steps #2682
-
What would be the recommended way to handle external files that require more elaborate extraction than a single command? As an example, I'd like make Apple's SF fonts part of my chezmoi-mananged setup. They only distribute these on disk images, which contain compressed archives in a special Apple format. So the steps to install the font files would be something like:
It doesn't seem like this is the kind of process that Chezmoi is a wonderful tool; thanks for your work! |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 7 replies
-
One simple solution is to add the extracted font files in ~/Library/Fonts directly to your dotfiles repo, i.e. run $ chezmoi add ~/Library/Fonts/SF-*.otf This is declarative, at the expense of making updates to the fonts a manual process. It would be theoretically possible to use Although declarative approaches are nice, in practice a |
Beta Was this translation helpful? Give feedback.
-
That makes sense! I will stick with the |
Beta Was this translation helpful? Give feedback.
One simple solution is to add the extracted font files in ~/Library/Fonts directly to your dotfiles repo, i.e. run
$ chezmoi add ~/Library/Fonts/SF-*.otf
This is declarative, at the expense of making updates to the fonts a manual process.
It would be theoretically possible to use
.chezmoiexternal.filter
where the filter is a script that you've written that performs the necessary steps to convert the.dmg
into a an archive that chezmoi can unpack. However, this would be very inefficient in practice because chezmoi would need to apply the filter every time you runchezmoi diff
orchezmoi apply
to see if anything has changed.Although declarative approaches are nice, in practice a
run_once_
…