depot/third_party/nixpkgs/pkgs/applications/video/obs-studio/wrapper.nix
Default email 02cf88bb76 Project import generated by Copybara.
GitOrigin-RevId: c4a0efdd5a728e20791b8d8d2f26f90ac228ee8d
2022-08-12 15:06:08 +03:00

29 lines
796 B
Nix

{ lib, obs-studio, symlinkJoin, makeWrapper }:
{ plugins ? [] }:
symlinkJoin {
name = "wrapped-${obs-studio.name}";
nativeBuildInputs = [ makeWrapper ];
paths = [ obs-studio ] ++ plugins;
postBuild = with lib;
let
# Some plugins needs extra environment, see obs-gstreamer for an example.
pluginArguments =
lists.concatMap (plugin: plugin.obsWrapperArguments or []) plugins;
wrapCommand = [
"wrapProgram"
"$out/bin/obs"
''--set OBS_PLUGINS_PATH "$out/lib/obs-plugins"''
''--set OBS_PLUGINS_DATA_PATH "$out/share/obs/obs-plugins"''
] ++ pluginArguments;
in concatStringsSep " " wrapCommand;
inherit (obs-studio) meta;
passthru = obs-studio.passthru // {
passthru.unwrapped = obs-studio;
};
}