diff --git a/systems/common/obs.nix b/systems/common/obs.nix index 1397169..c6e3edc 100644 --- a/systems/common/obs.nix +++ b/systems/common/obs.nix @@ -1,15 +1,32 @@ { pkgs, libs, + config, ... -}: { - programs.obs-studio.enable = true; +}: let + cfg = config.services.obs; +in { + options.services.obs = { + autostart = pkgs.lib.mkOption { + type = pkgs.lib.types.bool; + default = false; + }; + }; - xdg.configFile = { - "autostart/obs-autostart.desktop" = libs.mkAutostart { - inherit pkgs; - name = "obs"; - command = "obs --startreplaybuffer"; + config = { + programs.obs-studio = { + enable = true; + plugins = with pkgs.obs-studio-plugins; [ + obs-source-record + ]; + }; + + xdg.configFile = pkgs.lib.mkIf cfg.autostart { + "autostart/obs-autostart.desktop" = libs.mkAutostart { + inherit pkgs; + name = "obs"; + command = "obs --startreplaybuffer"; + }; }; }; } diff --git a/systems/laptop/default.nix b/systems/laptop/default.nix index 26ce054..57472fa 100644 --- a/systems/laptop/default.nix +++ b/systems/laptop/default.nix @@ -1,4 +1,4 @@ -{...}: { +{pkgs, ...}: { targets.genericLinux.enable = false; programs.bash.shellAliases = { @@ -11,4 +11,6 @@ power-button-action = "hibernate"; }; }; + + services.obs.autostart = false; } diff --git a/systems/pc/default.nix b/systems/pc/default.nix index e2e4504..17b6862 100644 --- a/systems/pc/default.nix +++ b/systems/pc/default.nix @@ -1,4 +1,8 @@ -{...}: { +{ + pkgs, + # options, + ... +}: { targets.genericLinux.enable = false; programs.bash.shellAliases = { @@ -11,4 +15,6 @@ power-button-action = "suspend"; }; }; + + services.obs.autostart = true; }