nixcord: init (#767)

Link: https://github.com/danth/stylix/pull/767

Reviewed-by: Daniel Thwaites <danth@danth.me>
Reviewed-by: NAHO <90870942+trueNAHO@users.noreply.github.com>
This commit is contained in:
Ari 2025-01-23 12:42:09 -06:00 committed by GitHub
parent 36c39ff014
commit e594886eb0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

27
modules/nixcord/hm.nix Normal file
View file

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