mirror of
https://github.com/nix-community/home-manager
synced 2024-11-27 07:00:48 +00: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;
|
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 {
|
in {
|
||||||
meta.maintainers = [ maintainers.adisbladis ];
|
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 {
|
plugins = mkOption {
|
||||||
default = [ ];
|
default = [ ];
|
||||||
example = literalExample "[ pkgs.obs-linuxbrowser ]";
|
example = literalExample "[ pkgs.obs-studio-plugins.wlrobs ]";
|
||||||
description = "Optional OBS plugins.";
|
description = "Optional OBS plugins.";
|
||||||
type = types.listOf types.package;
|
type = types.listOf types.package;
|
||||||
};
|
};
|
||||||
|
@ -47,9 +39,10 @@ in {
|
||||||
};
|
};
|
||||||
|
|
||||||
config = mkIf cfg.enable {
|
config = mkIf cfg.enable {
|
||||||
home.packages = [ cfg.package ];
|
home.packages = [ cfg.finalPackage ];
|
||||||
|
programs.obs-studio.finalPackage =
|
||||||
xdg.configFile."obs-studio/plugins" =
|
pkgs.wrapOBS.override { obs-studio = cfg.package; } {
|
||||||
mkIf (cfg.plugins != [ ]) { source = mkPluginEnv cfg.plugins; };
|
plugins = cfg.plugins;
|
||||||
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue