Files
nixpkgs/pkgs/by-name/op/openrgb/system-plugins-env.patch
Matt Sturgeon e8bb6bb879 openrgb: 0.9 → 1.0rc2
- https://codeberg.org/OpenRGB/OpenRGB/releases/tag/release_candidate_1.0rc1
> Plugin API has been updated to API version 4 so until the official 1.0
> release, use the latest pipeline builds of the plugins.

- https://codeberg.org/OpenRGB/OpenRGB/releases/tag/release_candidate_1.0rc2
> There have been some upgrades to the user interface since 1.0rc1 and
> some additional device support and fixes.
> The plugin interface and SDK version remain the same as 1.0rc1, so
> plugins that worked with 1.0rc1 should work with 1.0rc2 as well.

As part of updating `withPlugins`, it has been re-implemented as a
wrapper derivation. This means the base package is not re-compiled when
it is used.

Co-authored-by: liberodark <liberodark@gmail.com>
Co-authored-by: Multipixelone <finn@cnwr.net>
2026-01-08 20:23:31 +00:00

24 lines
1.1 KiB
Diff

diff --git a/PluginManager.cpp b/PluginManager.cpp
index 157b6cd5..42d9b59d 100644
--- a/PluginManager.cpp
+++ b/PluginManager.cpp
@@ -59,6 +59,18 @@ void PluginManager::ScanAndLoadPlugins()
filesystem::path plugins_dir = ResourceManager::get()->GetConfigurationDirectory() / plugins_path;
ScanAndLoadPluginsFrom(plugins_dir, false);
+ /*---------------------------------------------------------*\
+ | Get the system plugins directory from the environment |
+ | |
+ | Allow setting a system plugin directory during runtime, |
+ | e.g. by Nixpkgs' `withPlugins` wrapper. |
+ \*---------------------------------------------------------*/
+ const char* system_plugins_dir = std::getenv("OPENRGB_SYSTEM_PLUGIN_DIRECTORY");
+ if(system_plugins_dir && *system_plugins_dir)
+ {
+ ScanAndLoadPluginsFrom(system_plugins_dir, true);
+ }
+
#ifdef OPENRGB_SYSTEM_PLUGIN_DIRECTORY
/*---------------------------------------------------------*\
| Get the system plugins directory |