From be606eaa87dfcf22c98f80453b42ec40dcbcdf36 Mon Sep 17 00:00:00 2001 From: Flameopathic <64027365+Flameopathic@users.noreply.github.com> Date: Sat, 8 Feb 2025 15:42:34 -0500 Subject: [PATCH] {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> --- modules/vencord/hm.nix | 20 +++++++++++++++----- modules/vesktop/hm.nix | 24 +++++++++++++++++------- 2 files changed, 32 insertions(+), 12 deletions(-) diff --git a/modules/vencord/hm.nix b/modules/vencord/hm.nix index 8252c49b..85c5c536 100644 --- a/modules/vencord/hm.nix +++ b/modules/vencord/hm.nix @@ -1,9 +1,19 @@ { config, lib, ... }: let - themeFile = config.lib.stylix.colors { - template = ./template.mustache; - extension = ".css"; - }; + themeText = + builtins.readFile ( + config.lib.stylix.colors { + template = ./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.vencord.enable = @@ -12,6 +22,6 @@ in config = lib.mkIf (config.stylix.enable && config.stylix.targets.vencord.enable) { - xdg.configFile."Vencord/themes/stylix.theme.css".source = themeFile; + xdg.configFile."Vencord/themes/stylix.theme.css".text = themeText; }; } diff --git a/modules/vesktop/hm.nix b/modules/vesktop/hm.nix index 997f6a98..e48f3a0a 100644 --- a/modules/vesktop/hm.nix +++ b/modules/vesktop/hm.nix @@ -5,10 +5,20 @@ ... }: let - themeFile = config.lib.stylix.colors { - template = ../vencord/template.mustache; - extension = ".css"; - }; + 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 = @@ -19,12 +29,12 @@ in ( lib.mkMerge [ (lib.mkIf pkgs.stdenv.hostPlatform.isLinux { - xdg.configFile."vesktop/themes/stylix.theme.css".source = themeFile; + 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".source = - themeFile; + home.file."Library/Application Support/vesktop/themes/stylix.theme.css".text = + themeText; }) ] );