Feature Request: Local settings override
In a Nutshell
TLDR: I would like to have machine-specific configs/settings that are merged with synced configs only on the appropriate machine. This is a probably a big feature request but I am curious to know if it's something you've thought about.
Scenario
I have two Macs, one for work and one for personal use. For the most part I am happy to sync settings between them, and can control syncing apps that are work- or home-specific with the configuration file, but for some apps (e.g. ZSH or VSCode) I have settings I use at work that aren't useful for home. For example:
- I use GoogleCloud at work and have setup scripts for it in
.zshrc, but don't need or want to have google cloud SDK on my home machine. - VSCode uses specific formatters and linters at work, but I like using different ones at home
I can work around some of these issues on a case-by-case basis (e.g. $HOST-specific sections of .zshrc) but others are trickier/impossible without automated merging logic.
Proposed Solution
Many app use common text-based formats to store their settings, which makes it possible to do a simple override. The strategy may differ based on the app or settings. For Example:
- ZSH/Bash profiles could append an override file to the base config file, allowing the override to overwrite or unset outputs from the base
- Apps that use key/value pairs in INI files could have values for specific keys in an override file, and use them to overwrite the values in the base file
- Apps that use JSON config files could similarly have a JSON blob that gets merged with the base config file with the override values taking precedence
This is likely a developer-oriented feature so I don't think it is unreasonable to expect developers to hand-craft override files on a case-by-case basis. Mackup would then be responsible for syncing these files, and performing the merge when running mackup restore on the specific machine. Overrides could be host/user specific, or use a profile mechanism in the .mackup.cfg file (e.g. set the local machine profile to "foo" and find override files like .zshrc.foo.override.
If this isn't something you're currently thinking about I'm willing to work on adding this feature, but would love to know beforehand if you'll consider my pull request :)
I'd suggest a different .mackup.cfg file for each of your computers. It's pretty easy to create a whitelist of the apps you want to sync.
I think overall, mackup is meant to stay simple. We would want to be careful how we approach a programmatic change to how mackup works to not confuse the users.