Skip to content

Commit

Permalink
{vesktop, vencord}: fonts
Browse files Browse the repository at this point in the history
  • Loading branch information
Flameopathic committed Feb 8, 2025
1 parent ff8ce4f commit 51e38d1
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 12 deletions.
20 changes: 15 additions & 5 deletions modules/vencord/hm.nix
Original file line number Diff line number Diff line change
@@ -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 =
Expand All @@ -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;
};
}
24 changes: 17 additions & 7 deletions modules/vesktop/hm.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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 =
Expand All @@ -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;
})
]
);
Expand Down

0 comments on commit 51e38d1

Please sign in to comment.