From ee4385d743ff6c3e90771c7eb7caadec9868ad2d Mon Sep 17 00:00:00 2001 From: Austin Horstman Date: Mon, 16 Oct 2023 23:03:38 -0500 Subject: [PATCH] refactor: move obs to home-manager --- .../khaneliman@khanelinix/default.nix | 1 + modules/{nixos => home}/apps/obs/default.nix | 21 ++++++++-------- modules/home/suites/video/default.nix | 25 +++++++++++++++++++ modules/nixos/suites/video/default.nix | 8 +----- 4 files changed, 38 insertions(+), 17 deletions(-) rename modules/{nixos => home}/apps/obs/default.nix (55%) create mode 100644 modules/home/suites/video/default.nix diff --git a/homes/x86_64-linux/khaneliman@khanelinix/default.nix b/homes/x86_64-linux/khaneliman@khanelinix/default.nix index 21fd53ca1..58b27b38f 100644 --- a/homes/x86_64-linux/khaneliman@khanelinix/default.nix +++ b/homes/x86_64-linux/khaneliman@khanelinix/default.nix @@ -76,6 +76,7 @@ in }; music = enabled; social = enabled; + video = enabled; }; tools = { diff --git a/modules/nixos/apps/obs/default.nix b/modules/home/apps/obs/default.nix similarity index 55% rename from modules/nixos/apps/obs/default.nix rename to modules/home/apps/obs/default.nix index 651e5c593..7a3ddfb59 100644 --- a/modules/nixos/apps/obs/default.nix +++ b/modules/home/apps/obs/default.nix @@ -16,15 +16,16 @@ in }; config = mkIf cfg.enable { - environment.systemPackages = [ - (pkgs.wrapOBS { - plugins = with pkgs.obs-studio-plugins; [ - looking-glass-obs - obs-move-transition - obs-multi-rtmp - wlrobs - ]; - }) - ]; + programs.obs-studio = { + enable = true; + package = pkgs.obs-studio; + + plugins = with pkgs.obs-studio-plugins; [ + looking-glass-obs + obs-move-transition + obs-multi-rtmp + wlrobs + ]; + }; }; } diff --git a/modules/home/suites/video/default.nix b/modules/home/suites/video/default.nix new file mode 100644 index 000000000..52136e73a --- /dev/null +++ b/modules/home/suites/video/default.nix @@ -0,0 +1,25 @@ +{ config +, lib +, options +, pkgs +, ... +}: +let + inherit (lib) mkIf; + inherit (lib.internal) mkBoolOpt enabled; + + cfg = config.khanelinix.suites.video; +in +{ + options.khanelinix.suites.video = { + enable = mkBoolOpt false "Whether or not to enable video configuration."; + }; + + config = mkIf cfg.enable { + khanelinix = { + apps = { + obs = enabled; + }; + }; + }; +} diff --git a/modules/nixos/suites/video/default.nix b/modules/nixos/suites/video/default.nix index b3a3a539d..b7ae3b926 100644 --- a/modules/nixos/suites/video/default.nix +++ b/modules/nixos/suites/video/default.nix @@ -6,7 +6,7 @@ }: let inherit (lib) mkIf; - inherit (lib.internal) mkBoolOpt enabled; + inherit (lib.internal) mkBoolOpt; cfg = config.khanelinix.suites.video; in @@ -21,11 +21,5 @@ in pitivi vlc ]; - - khanelinix = { - apps = { - obs = enabled; - }; - }; }; }