diff --git a/beets/util/confit.py b/beets/util/confit.py index 4c5b30cb6..6c3dd3cb2 100644 --- a/beets/util/confit.py +++ b/beets/util/confit.py @@ -779,6 +779,16 @@ class Configuration(RootView): if os.path.isfile(filename): self.add(ConfigSource(load_yaml(filename) or {}, filename)) + try: + included_filenames = self['include'].get(list) + except NotFoundError: + included_filenames = [] + + for filename in included_filenames: + filename = os.path.join(self.config_dir(), filename) + if os.path.isfile(filename): + self.add(ConfigSource(load_yaml(filename) or {}, filename)) + def _add_default_source(self): """Add the package's default configuration settings. This looks for a YAML file located inside the package for the module diff --git a/docs/changelog.rst b/docs/changelog.rst index 89fd084c0..1aa89ef1e 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -22,6 +22,7 @@ The new features: trigger a "lots of music" warning. :bug:`1577` * :doc:`/plugins/plexupdate`: A new ``library_name`` option allows you to select which Plex library to update. :bug:`1572` :bug:`1595` +* Add new `include` config option to allow including external config files. Fixes: diff --git a/docs/reference/config.rst b/docs/reference/config.rst index 8494dba07..e01711111 100644 --- a/docs/reference/config.rst +++ b/docs/reference/config.rst @@ -64,6 +64,12 @@ plugins A space-separated list of plugin module names to load. See :ref:`using-plugins`. +include +~~~~~~~ + +A space-separated list of extra configuration files to include. +Filenames are relative to the directory containing ``config.yaml``. + pluginpath ~~~~~~~~~~