mirror of
https://github.com/nix-community/home-manager
synced 2024-11-26 21:19:45 +01:00
obs-studio: use wrapobs and the new plugin layout (#2142)
The packaging in nixpkgs for obs plugins has changed and there's a wrapOBS function. The name of the plugins has also changed so the example needed updating to reflect that. Related: https://github.com/NixOS/nixpkgs/pull/125308
This commit is contained in:
parent
0ada50fc9c
commit
8eee5f5272
1 changed files with 13 additions and 20 deletions
|
@ -6,21 +6,6 @@ let
|
|||
|
||||
cfg = config.programs.obs-studio;
|
||||
|
||||
mkPluginEnv = packages:
|
||||
let
|
||||
pluginDirs = map (pkg: "${pkg}/share/obs/obs-plugins") packages;
|
||||
plugins = concatMapStringsSep " " (p: "${p}/*") pluginDirs;
|
||||
in pkgs.runCommand "obs-studio-plugins" {
|
||||
preferLocalBuild = true;
|
||||
allowSubstitutes = false;
|
||||
} ''
|
||||
mkdir $out
|
||||
[[ '${plugins}' ]] || exit 0
|
||||
for plugin in ${plugins}; do
|
||||
ln -s "$plugin" $out/
|
||||
done
|
||||
'';
|
||||
|
||||
in {
|
||||
meta.maintainers = [ maintainers.adisbladis ];
|
||||
|
||||
|
@ -37,9 +22,16 @@ in {
|
|||
'';
|
||||
};
|
||||
|
||||
finalPackage = mkOption {
|
||||
type = types.package;
|
||||
visible = false;
|
||||
readOnly = true;
|
||||
description = "Resulting customized OBS Studio package.";
|
||||
};
|
||||
|
||||
plugins = mkOption {
|
||||
default = [ ];
|
||||
example = literalExample "[ pkgs.obs-linuxbrowser ]";
|
||||
example = literalExample "[ pkgs.obs-studio-plugins.wlrobs ]";
|
||||
description = "Optional OBS plugins.";
|
||||
type = types.listOf types.package;
|
||||
};
|
||||
|
@ -47,9 +39,10 @@ in {
|
|||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
home.packages = [ cfg.package ];
|
||||
|
||||
xdg.configFile."obs-studio/plugins" =
|
||||
mkIf (cfg.plugins != [ ]) { source = mkPluginEnv cfg.plugins; };
|
||||
home.packages = [ cfg.finalPackage ];
|
||||
programs.obs-studio.finalPackage =
|
||||
pkgs.wrapOBS.override { obs-studio = cfg.package; } {
|
||||
plugins = cfg.plugins;
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue