{
config,
lib,
...
}: let
cfg = config.roles.obs;
in {
options.roles.obs = {
enable = lib.mkEnableOption "OBS Studio";
enableVirtualCamera = lib.mkEnableOption "OBS virtual camera"; # TODO: implement lol
};
config = lib.mkIf cfg.enable {
hm.programs.obs-studio = {
enable = true;
};
boot.extraModulePackages = [
config.boot.kernelPackages.v4l2loopback
];
boot.extraModprobeConfig = ''
options v4l2loopback devices=1 video_nr=1 card_label="OBS virtual camera" exclusive_caps=1
'';
};
}