DEVELOPMENT ENVIRONMENT

~liljamo/nix-arta

d9344ca79c21f2dde53ec00671d07d44d62b49e9 — Jonni Liljamo 2 months ago 5f45344
feat: obs
3 files changed, 31 insertions(+), 0 deletions(-)

M hosts/alice/default.nix
M roles/default.nix
A roles/obs.nix
M hosts/alice/default.nix => hosts/alice/default.nix +5 -0
@@ 57,4 57,9 @@
    lutris.enable = true;
    steam.enable = true;
  };

  roles.obs = {
    enable = true;
    enableVirtualCamera = true;
  };
}

M roles/default.nix => roles/default.nix +1 -0
@@ 12,6 12,7 @@
    ./hyprland.nix
    ./kitty.nix
    ./nix.nix
    ./obs.nix
    ./plasma.nix
    ./prometheus.nix
    ./qutebrowser.nix

A roles/obs.nix => roles/obs.nix +25 -0
@@ 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
    '';
  };
}