brisberg / dotfiles

Personal dotfile repository
MIT License
0 stars 0 forks source link

Refactor to use feature flags and host definitions #5

Open brisberg opened 2 years ago

brisberg commented 2 years ago

An alternative to using branch based definitions for each host.

In this model, there is only one branch in this repo (main). All hosts will download it and use it directly. Many areas of the scripts will use conditionals based on env variables to enable or disable certain configurations.

Each host would define their own (or I commit the host definitions here). They would have a file which defines settings for the host (name, hostname, OS ect) as well as the set of feature I want enabled on that host.

For example, that way I can enable Godot on my laptop and desktop, but not on my work machine or raspberrypi.

Pros: Reduced 'merge' commits as I no longer need to propogate configs down stream. Easier to understand 'where' configs should go. Right now I need to decide if they are common to all hosts or just one based on where I commit it. Easier time modifying similar configs on multiple hosts, since they will all use the same script definitions.


Still not sure if branch based or feature flag based is the best option. It relies on different hosts being similar enough for them to work reasonably well with course grain feature flags.

For now I'll stick with branch based until it no longer works.