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, pkgs,
libs, libs,
config,
... ...
}: { }: let
programs.obs-studio.enable = true; cfg = config.services.obs;
in {
options.services.obs = {
autostart = pkgs.lib.mkOption {
type = pkgs.lib.types.bool;
default = false;
};
};
xdg.configFile = { config = {
"autostart/obs-autostart.desktop" = libs.mkAutostart { programs.obs-studio = {
inherit pkgs; enable = true;
name = "obs"; plugins = with pkgs.obs-studio-plugins; [
command = "obs --startreplaybuffer"; 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; targets.genericLinux.enable = false;
programs.bash.shellAliases = { programs.bash.shellAliases = {
@ -11,4 +11,6 @@
power-button-action = "hibernate"; power-button-action = "hibernate";
}; };
}; };
services.obs.autostart = false;
} }

View File

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