From e594886eb0951a0a0c28ffa333a9df6fb13857a1 Mon Sep 17 00:00:00 2001 From: Ari <54780610+ari-rs@users.noreply.github.com> Date: Thu, 23 Jan 2025 12:42:09 -0600 Subject: [PATCH] nixcord: init (#767) Link: https://github.com/danth/stylix/pull/767 Reviewed-by: Daniel Thwaites Reviewed-by: NAHO <90870942+trueNAHO@users.noreply.github.com> --- modules/nixcord/hm.nix | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 modules/nixcord/hm.nix diff --git a/modules/nixcord/hm.nix b/modules/nixcord/hm.nix new file mode 100644 index 00000000..0a1ccb05 --- /dev/null +++ b/modules/nixcord/hm.nix @@ -0,0 +1,27 @@ +{ + config, + lib, + options, + ... +}: +let + themeFile = config.lib.stylix.colors { + template = ../vencord/template.mustache; + extension = ".css"; + }; + themeFileName = "stylix.theme.css"; + cfg = config.stylix.targets.nixcord; +in +{ + options.stylix.targets.nixcord.enable = + config.lib.stylix.mkEnableTarget "Nixcord" true; + + config = + lib.mkIf (config.stylix.enable && cfg.enable && (config.programs ? nixcord)) + ( + lib.optionalAttrs (builtins.hasAttr "nixcord" options.programs) { + xdg.configFile."Vencord/themes/stylix.theme.css".source = themeFile; + programs.nixcord.config.enabledThemes = [ themeFileName ]; + } + ); +}