about summary refs log tree commit diff
path: root/pkgs/applications/video
diff options
context:
space:
mode:
authorAtemu <atemu.main@gmail.com>2022-09-01 23:08:43 +0200
committerAtemu <atemu.main@gmail.com>2022-09-02 01:08:26 +0200
commitc5e6fb193b3deeca682f7da7709f60782ac2a0a8 (patch)
treeda15617d15510ba74facff88a4ceae513d873ab4 /pkgs/applications/video
parent97747d3209efde533f7b1b28f1be11619f556a06 (diff)
obs-studio: include plugins in wrapper again
If the user asks for a plugin that does come with their own binaries or other
files to be included in their OBS installation, it should include those files. A
good example is obs-vkcapture which /requires/ system-wide files to have any use
whatsoever.

Plugins' paths were removed from the wrapper in step with preventing OBS from
loading plugins twice but wasn't actually required because the env variables
already point at the one and only location for plugins. The plugins' share dirs
don't get put in the system-wide share by default on NixOS but I decided to
remove the directory anyways for clarity.

Partially reverts 593d64f975e4e7d9439562d3f857d85e8be66012

Co-authored-by: Pedro Lara Campos <pedro.laracampos@gmail.com>
Diffstat (limited to 'pkgs/applications/video')
-rw-r--r--pkgs/applications/video/obs-studio/wrapper.nix13
1 files changed, 10 insertions, 3 deletions
diff --git a/pkgs/applications/video/obs-studio/wrapper.nix b/pkgs/applications/video/obs-studio/wrapper.nix
index 28efefbd00421..5303991f1fb96 100644
--- a/pkgs/applications/video/obs-studio/wrapper.nix
+++ b/pkgs/applications/video/obs-studio/wrapper.nix
@@ -6,7 +6,7 @@ symlinkJoin {
   name = "wrapped-${obs-studio.name}";
 
   nativeBuildInputs = [ makeWrapper ];
-  paths = [ obs-studio ];
+  paths = [ obs-studio ] ++ plugins;
 
   postBuild = with lib;
     let
@@ -19,13 +19,20 @@ symlinkJoin {
         paths = plugins;
       };
 
-      wrapCommand = [
+      wrapCommandLine = [
           "wrapProgram"
           "$out/bin/obs"
           ''--set OBS_PLUGINS_PATH "${pluginsJoined}/lib/obs-plugins"''
           ''--set OBS_PLUGINS_DATA_PATH "${pluginsJoined}/share/obs/obs-plugins"''
         ] ++ pluginArguments;
-    in concatStringsSep " " wrapCommand;
+    in ''
+    ${concatStringsSep " " wrapCommandLine}
+
+    # Remove unused obs-plugins dir to not cause confusion
+    rm -r $out/share/obs/obs-plugins
+    # Leave some breadcrumbs
+    echo 'Plugins are at ${pluginsJoined}/share/obs/obs-plugins' > $out/share/obs/obs-plugins-README
+  '';
 
   inherit (obs-studio) meta;
   passthru = obs-studio.passthru // {