Load config from /usr/share
Currently the docs say config is only read from the following locations:
- /etc/buffyboard.conf
- /etc/buffyboard.conf.d/* (alphabetically)
Distros may want to provide some default config, and installing into /etc is bad practice (and makes it harder to implement things like rootfs immutability in some designs). I think the order of preference should be (starting with the highest priority):
/etc/buffyboard.d/*
/etc/buffyboard.conf
/usr/share/buffyboard.d/*
/usr/share/buffyboard.conf
Config in (2) can only override config in (3) and (4). Config in (1) can override the others (2), (3), (4). Config in (4) can not override config from anywhere else. Config in the .d
dirs is read in alphanumerically, and can override earlier config in the same .d
dir.
To implement this, the app might read in config from files in the reverse order (starting with (4) and ending with (1)), so that it could detect/apply overrides to config it has already read in.
The idea being that distros can override default config you ship in releases by adding it to /usr/share through distro packaging/config, and users can override upstream and/or distro configs with their own in /etc. We follow this pattern with other things in pmOS, and it's from FHS