11.stylix/modules/vesktop/hm.nix
Flameopathic be606eaa87
{vencord,vesktop}: fonts (#840)
Closes: https://github.com/danth/stylix/issues/829
Link: https://github.com/danth/stylix/pull/840

Reviewed-by: NAHO <90870942+trueNAHO@users.noreply.github.com>
2025-02-08 21:42:34 +01:00

41 lines
1,005 B
Nix

{
pkgs,
config,
lib,
...
}:
let
themeText =
builtins.readFile (
config.lib.stylix.colors {
template = ../vencord/template.mustache;
extension = ".css";
}
)
+ ''
:root {
--font-primary: ${config.stylix.fonts.sansSerif.name};
--font-display: ${config.stylix.fonts.sansSerif.name};
--font-code: ${config.stylix.fonts.monospace.name};
}
'';
in
{
options.stylix.targets.vesktop.enable =
config.lib.stylix.mkEnableTarget "Vesktop" true;
config =
lib.mkIf (config.stylix.enable && config.stylix.targets.vesktop.enable)
(
lib.mkMerge [
(lib.mkIf pkgs.stdenv.hostPlatform.isLinux {
xdg.configFile."vesktop/themes/stylix.theme.css".text = themeText;
})
(lib.mkIf pkgs.stdenv.hostPlatform.isDarwin {
home.file."Library/Application Support/vesktop/themes/stylix.theme.css".text =
themeText;
})
]
);
}