From d9344ca79c21f2dde53ec00671d07d44d62b49e9 Mon Sep 17 00:00:00 2001 From: Jonni Liljamo Date: Sat, 21 Sep 2024 17:34:57 +0300 Subject: [PATCH] feat: obs --- hosts/alice/default.nix | 5 +++++ roles/default.nix | 1 + roles/obs.nix | 25 +++++++++++++++++++++++++ 3 files changed, 31 insertions(+) create mode 100644 roles/obs.nix diff --git a/hosts/alice/default.nix b/hosts/alice/default.nix index 0f9ba09..855f911 100644 --- a/hosts/alice/default.nix +++ b/hosts/alice/default.nix @@ -57,4 +57,9 @@ lutris.enable = true; steam.enable = true; }; + + roles.obs = { + enable = true; + enableVirtualCamera = true; + }; } diff --git a/roles/default.nix b/roles/default.nix index 1698599..9a11e44 100644 --- a/roles/default.nix +++ b/roles/default.nix @@ -12,6 +12,7 @@ ./hyprland.nix ./kitty.nix ./nix.nix + ./obs.nix ./plasma.nix ./prometheus.nix ./qutebrowser.nix diff --git a/roles/obs.nix b/roles/obs.nix new file mode 100644 index 0000000..dc1a5e2 --- /dev/null +++ b/roles/obs.nix @@ -0,0 +1,25 @@ +{ + 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 + ''; + }; +} -- 2.44.1