From a394d51da2d17b335cfdc9947b6d83c455d13bf0 Mon Sep 17 00:00:00 2001 From: arminius-smh Date: Sat, 31 Aug 2024 01:34:42 +0200 Subject: [PATCH] feat(home-manager): add support for obs-studio --- .sources/sources.json | 12 ++++++++++++ modules/home-manager/all-modules.nix | 1 + modules/home-manager/obs-studio.nix | 16 ++++++++++++++++ tests/darwin.nix | 1 + tests/home.nix | 1 + 5 files changed, 31 insertions(+) create mode 100644 modules/home-manager/obs-studio.nix diff --git a/.sources/sources.json b/.sources/sources.json index 04ecf5dc..20735809 100644 --- a/.sources/sources.json +++ b/.sources/sources.json @@ -300,6 +300,18 @@ "url": "https://github.com/catppuccin/nvim/archive/4fd72a9ab64b393c2c22b168508fd244877fec96.tar.gz", "hash": "1fznbifj9xayimdjld2zhn9003mgp93sd87lpaky7pr6nsgsgnb8" }, + "obs": { + "type": "Git", + "repository": { + "type": "GitHub", + "owner": "catppuccin", + "repo": "obs" + }, + "branch": "main", + "revision": "b17939991545bdd6232e688ec5004b6dfae46f69", + "url": "https://github.com/catppuccin/obs/archive/b17939991545bdd6232e688ec5004b6dfae46f69.tar.gz", + "hash": "15ndpcy8a37997vd14z08arlv3zk5ldlmb7s7i63dz15yxqnaaym" + }, "palette": { "type": "Git", "repository": { diff --git a/modules/home-manager/all-modules.nix b/modules/home-manager/all-modules.nix index 0d30f02b..cbf5bf1d 100644 --- a/modules/home-manager/all-modules.nix +++ b/modules/home-manager/all-modules.nix @@ -39,6 +39,7 @@ ./sway.nix ./tmux.nix ./tofi.nix + ./obs-studio.nix ./waybar.nix ./yazi.nix ./zathura.nix diff --git a/modules/home-manager/obs-studio.nix b/modules/home-manager/obs-studio.nix new file mode 100644 index 00000000..d739bac2 --- /dev/null +++ b/modules/home-manager/obs-studio.nix @@ -0,0 +1,16 @@ +{ config, lib, ... }: +let + inherit (config.catppuccin) sources; + cfg = config.programs.obs-studio.catppuccin; + enable = cfg.enable && config.programs.obs-studio.enable; + + themeName = "Catppuccin_${lib.ctp.mkUpper cfg.flavor}.ovt"; +in +{ + options.programs.obs-studio.catppuccin = lib.ctp.mkCatppuccinOpt {name = "obs-studio";}; + + config = lib.mkIf enable { + xdg.configFile."obs-studio/themes/Catppuccin.obt".source = "${sources.obs}/themes/Catppuccin.obt"; + xdg.configFile."obs-studio/themes/${themeName}".source = "${sources.obs}/themes/${themeName}"; + }; +} diff --git a/tests/darwin.nix b/tests/darwin.nix index ca72f813..09eb5e6c 100644 --- a/tests/darwin.nix +++ b/tests/darwin.nix @@ -21,6 +21,7 @@ fuzzel.enable = lib.mkForce false; imv.enable = lib.mkForce false; mpv.enable = lib.mkForce false; # NOTE: same as cava, but `mpv` fails to build currently + obs-studio.enable = lib.mkForce false; rio.enable = lib.mkForce false; # marked as broken rofi.enable = lib.mkForce false; swaylock.enable = lib.mkForce false; diff --git a/tests/home.nix b/tests/home.nix index 004ceced..851dc23e 100644 --- a/tests/home.nix +++ b/tests/home.nix @@ -52,6 +52,7 @@ swaylock.enable = true; tmux.enable = true; tofi.enable = true; + obs-studio.enable = true; waybar.enable = true; yazi.enable = true; zathura.enable = true;