massive lsp evaluated rewrite
This commit is contained in:
@@ -1,21 +1,16 @@
|
||||
{ pkgs, lib, config, ... }:
|
||||
|
||||
with lib;
|
||||
|
||||
let cfg = config.programs.obs-studio;
|
||||
in {
|
||||
options.programs.obs-studio = {
|
||||
enable = mkEnableOption "OBS Studio program";
|
||||
|
||||
package = mkOption {
|
||||
type = types.package;
|
||||
enable = lib.mkEnableOption "OBS Studio program";
|
||||
package = lib.mkOption {
|
||||
type = lib.types.package;
|
||||
default = pkgs.obs-studio;
|
||||
defaultText = "pkgs.obs-studio";
|
||||
description = "Set obs-studio package to use.";
|
||||
};
|
||||
|
||||
enableVirtualCamera = mkOption {
|
||||
type = types.bool;
|
||||
enableVirtualCamera = lib.mkOption {
|
||||
type = lib.types.bool;
|
||||
default = false;
|
||||
description = ''
|
||||
Installs and sets up the v4l2loopback kernel module, necesary for OBS
|
||||
@@ -23,20 +18,15 @@ in {
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
config = lib.mkIf cfg.enable {
|
||||
environment.systemPackages = [ cfg.package ];
|
||||
|
||||
boot = mkIf cfg.enableVirtualCamera {
|
||||
boot = lib.mkIf cfg.enableVirtualCamera {
|
||||
extraModulePackages = with config.boot.kernelPackages; [ v4l2loopback ];
|
||||
|
||||
extraModprobeConfig = ''
|
||||
options v4l2loopback devices=1 video_nr=1 card_label="OBS Cam" exclusive_caps=1
|
||||
'';
|
||||
};
|
||||
|
||||
security.polkit.enable = mkIf cfg.enableVirtualCamera true;
|
||||
security.polkit.enable = lib.mkIf cfg.enableVirtualCamera true;
|
||||
};
|
||||
|
||||
meta.maintainers = with lib.maintainers; [ CaptainJawZ ];
|
||||
meta.maintainers = [ lib.maintainers.CaptainJawZ ];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user