obs-studio: add module
This commit is contained in:
parent
6957911657
commit
a2d13648c2
|
@ -807,6 +807,14 @@ in
|
|||
A new module is available: 'programs.go'.
|
||||
'';
|
||||
}
|
||||
|
||||
{
|
||||
time = "2018-09-26T03:55:16+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
|
||||
|
|
56
modules/programs/obs-studio.nix
Normal file
56
modules/programs/obs-studio.nix
Normal file
|
@ -0,0 +1,56 @@
|
|||
{ config, lib, pkgs, ... }:
|
||||
|
||||
with lib;
|
||||
|
||||
let
|
||||
|
||||
cfg = config.programs.obs-studio;
|
||||
package = pkgs.obs-studio;
|
||||
|
||||
mkPluginEnv = packages: let
|
||||
pluginDirs = builtins.map
|
||||
(pkg: "${pkg}/share/obs/obs-plugins") packages;
|
||||
in pkgs.runCommand "obs-studio-plugins" {} ''
|
||||
mkdir $out
|
||||
for plugin in ${builtins.concatStringsSep " "
|
||||
(builtins.map (p: "${p}/*") pluginDirs)}; do
|
||||
ln -s "$plugin" $out/
|
||||
done
|
||||
'';
|
||||
|
||||
in
|
||||
|
||||
{
|
||||
meta.maintainers = [ maintainers.adisbladis ];
|
||||
|
||||
options = {
|
||||
programs.obs-studio = {
|
||||
|
||||
enable = mkOption {
|
||||
default = false;
|
||||
example = true;
|
||||
description = "Whether to enable obs-studio.";
|
||||
type = types.bool;
|
||||
};
|
||||
|
||||
plugins = mkOption {
|
||||
default = [];
|
||||
example = literalExample "[ pkgs.obs-linuxbrowser ]";
|
||||
description = "Optional OBS plugins.";
|
||||
type = types.listOf types.package;
|
||||
};
|
||||
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable (mkMerge [
|
||||
{
|
||||
home.packages = [ package ];
|
||||
}
|
||||
|
||||
(mkIf (cfg.plugins != []) {
|
||||
xdg.configFile."obs-studio/plugins".source = mkPluginEnv cfg.plugins;
|
||||
})
|
||||
|
||||
]);
|
||||
}
|
Loading…
Reference in a new issue