obs-studio: add module
This commit is contained in:
parent
33a2943e8c
commit
f44d4a1d86
|
@ -807,6 +807,14 @@ in
|
|||
A new module is available: 'programs.go'.
|
||||
'';
|
||||
}
|
||||
|
||||
{
|
||||
time = "2018-09-27T17:48:08+00:00";
|
||||
message = ''
|
||||
A new module is available: 'programs.obs-studio'.
|
||||
'';
|
||||
}
|
||||
|
||||
];
|
||||
};
|
||||
}
|
||||
|
|
|
@ -51,6 +51,7 @@ let
|
|||
./programs/newsboat.nix
|
||||
./programs/noti.nix
|
||||
./programs/notmuch.nix
|
||||
./programs/obs-studio.nix
|
||||
./programs/offlineimap.nix
|
||||
./programs/pidgin.nix
|
||||
./programs/rofi.nix
|
||||
|
|
48
modules/programs/obs-studio.nix
Normal file
48
modules/programs/obs-studio.nix
Normal file
|
@ -0,0 +1,48 @@
|
|||
{ config, lib, pkgs, ... }:
|
||||
|
||||
with lib;
|
||||
|
||||
let
|
||||
|
||||
cfg = config.programs.obs-studio;
|
||||
package = pkgs.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" {} ''
|
||||
mkdir $out
|
||||
[[ '${plugins}' ]] || exit 0
|
||||
for plugin in ${plugins}; do
|
||||
ln -s "$plugin" $out/
|
||||
done
|
||||
'';
|
||||
|
||||
in
|
||||
|
||||
{
|
||||
meta.maintainers = [ maintainers.adisbladis ];
|
||||
|
||||
options = {
|
||||
programs.obs-studio = {
|
||||
enable = mkEnableOption "obs-studio";
|
||||
|
||||
plugins = mkOption {
|
||||
default = [];
|
||||
example = literalExample "[ pkgs.obs-linuxbrowser ]";
|
||||
description = "Optional OBS plugins.";
|
||||
type = types.listOf types.package;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
home.packages = [ package ];
|
||||
|
||||
xdg.configFile."obs-studio/plugins" = mkIf (cfg.plugins != []) {
|
||||
source = mkPluginEnv cfg.plugins;
|
||||
};
|
||||
};
|
||||
}
|
Loading…
Reference in a new issue