made option to set obs autostart behaviour

This commit is contained in:
Kristian Krsnik 2024-02-16 17:41:53 +01:00
parent ae4462d98f
commit ae6da0ecc4
Signed by: Kristian
GPG Key ID: FD1330AC9F909E85
3 changed files with 34 additions and 9 deletions

View File

@ -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";
};
};
};
}

View File

@ -1,4 +1,4 @@
{...}: {
{pkgs, ...}: {
targets.genericLinux.enable = false;
programs.bash.shellAliases = {
@ -11,4 +11,6 @@
power-button-action = "hibernate";
};
};
services.obs.autostart = false;
}

View File

@ -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;
}