twpayne / chezmoi

Manage your dotfiles across multiple diverse machines, securely.
https://www.chezmoi.io/
MIT License
12.63k stars 475 forks source link

Support for XDG base and user directories #2496

Closed Marathon2112 closed 1 year ago

Marathon2112 commented 1 year ago

A typical use case would be to back up templates in the XDG_TEMPLATES_DIR and deploy them on a machine with a different locale. The source directory could be ~/Templates, whereas the destination directory could be, say, ~/Modèles. They are conceptually the same folder, but chezmoi would create a ~/Templates folder on the second machine instead of using the correct locale.

twpayne commented 1 year ago

I'm sorry, I don't understand your request.

Environment variables like $XDG_TEMPLATES_DIR are already available in chezmoi's templates through the env template function.

What changes do you want to see to chezmoi?

Marathon2112 commented 1 year ago

My apologies, I had not taken a look at all the sprig functions available. I guess one could then create a template for moving the files to their correct location using env "XDG_TEMPLATES_DIR".

twpayne commented 1 year ago

Ah, storing files in different locations on different machines is a bit tricky at the moment. There's an FAQ entry with suggestions.

2273 should eventually make this easier, but I haven't started implementing yet.

twpayne commented 1 year ago

Hopefully this is now sorted (pending the #2273 enhancement, of course). Please re-open if needed.