ACTUALLY fix fonts

This commit is contained in:
Reid 2024-04-02 20:52:55 -07:00
parent 4465048b41
commit 02116e64f5
2 changed files with 89 additions and 85 deletions

View file

@ -25,8 +25,8 @@ let
cfg = config.modules.desktop.fonts;
in {
options.modules.desktop.fonts = {
enable = mkEnableOption "Enable the font configuration module, containing system fonts";
baseFonts = mkEnableOption "Add an set of extra base fonts";
enable = mkEnableOption "Enable the font configuration module, configuring your chosen fonts";
baseFonts = mkEnableOption "Add an extra set of base fonts";
fonts = {
sansSerif = mkFontOption "sansSerif" {
@ -62,7 +62,8 @@ in {
};
};
config = mkIf cfg.enable {
config = mkIf cfg.enable (mkMerge [
{
fonts = {
fontDir.enable = true;
fontconfig.enable = true;
@ -85,9 +86,26 @@ in {
cfg.fonts.monospaceBitmap.package
cfg.fonts.emoji.package
];
} // (mkIf cfg.baseFonts {
enableDefaultPackages = true;
packages = with pkgs; [
};
hm.gtk.enable = true;
# not the best way of writing this (imagine if `name` was named `family`...)
hm.gtk.font = with cfg.fonts.sansSerif; {
package = package;
name = family;
size = size;
};
hm.dconf.settings = {
"org/gnome/desktop/interface".font-name = with cfg.fonts.sansSerif; "${family} ${toString size}";
"org/gnome/desktop/interface".document-font-name = with cfg.fonts.serif; "${family} ${toString size}";
"org/gnome/desktop/interface".monospace-font-name = with cfg.fonts.monospace; "${family} ${toString size}";
};
}
(mkIf cfg.baseFonts {
fonts.enableDefaultPackages = true;
fonts.packages = with pkgs; [
fira-code
fira-code-symbols
mplus-outline-fonts.githubRelease
@ -100,20 +118,6 @@ in {
noto-fonts-monochrome-emoji
font-awesome
];
});
hm.gtk.enable = true;
hm.gtk.font = with cfg.fonts.sansSerif; { # im great at writing nix, right?
package = package;
name = family;
size = size;
};
hm.dconf.settings = {
"org/gnome/desktop/interface".font-name = with cfg.fonts.sansSerif; "${family} ${toString size}";
"org/gnome/desktop/interface".document-font-name = with cfg.fonts.serif; "${family} ${toString size}";
"org/gnome/desktop/interface".monospace-font-name = with cfg.fonts.monospace; "${family} ${toString size}";
};
};
})
]);
}