SuperCuber / dotter

A dotfile manager and templater written in rust 🦀
The Unlicense
900 stars 48 forks source link

[FEATURE] Switch `local.toml` search order to prioritize `hostname.toml` #188

Closed serkonda7 closed 1 month ago

serkonda7 commented 1 month ago

Is your feature request related to a problem? Please describe. I would like to commit local.toml into my dotfiles repo containing meaningful defaults. For specialized systems I want to have specific hostname.toml configurations. This however is not possible as local.toml will always be used first.

Describe the solution you'd like I would prefer a specific-over-general principle, thus looking for hostname first with a fallback to local.toml. Optionally for dotter watch, the used file could be cached, so the case of a frequent lookup of non-existent hostname.local would be prevented

Describe alternatives you've considered none

Additional context I would like to try implementing this myself, if it's approved.

SuperCuber commented 1 month ago

Adding a local.toml into source control is not really the intended use case. You could put your defaults in an included file and have a simple local.toml that includes it and selects a "defaults" package that depends on what you want.

Let me know if you have further questions :)