ACTUALLY fix fonts
This commit is contained in:
parent
4465048b41
commit
02116e64f5
2 changed files with 89 additions and 85 deletions
|
@ -25,8 +25,8 @@ let
|
||||||
cfg = config.modules.desktop.fonts;
|
cfg = config.modules.desktop.fonts;
|
||||||
in {
|
in {
|
||||||
options.modules.desktop.fonts = {
|
options.modules.desktop.fonts = {
|
||||||
enable = mkEnableOption "Enable the font configuration module, containing system fonts";
|
enable = mkEnableOption "Enable the font configuration module, configuring your chosen fonts";
|
||||||
baseFonts = mkEnableOption "Add an set of extra base fonts";
|
baseFonts = mkEnableOption "Add an extra set of base fonts";
|
||||||
|
|
||||||
fonts = {
|
fonts = {
|
||||||
sansSerif = mkFontOption "sansSerif" {
|
sansSerif = mkFontOption "sansSerif" {
|
||||||
|
@ -62,7 +62,8 @@ in {
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
config = mkIf cfg.enable {
|
config = mkIf cfg.enable (mkMerge [
|
||||||
|
{
|
||||||
fonts = {
|
fonts = {
|
||||||
fontDir.enable = true;
|
fontDir.enable = true;
|
||||||
fontconfig.enable = true;
|
fontconfig.enable = true;
|
||||||
|
@ -85,9 +86,26 @@ in {
|
||||||
cfg.fonts.monospaceBitmap.package
|
cfg.fonts.monospaceBitmap.package
|
||||||
cfg.fonts.emoji.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
|
||||||
fira-code-symbols
|
fira-code-symbols
|
||||||
mplus-outline-fonts.githubRelease
|
mplus-outline-fonts.githubRelease
|
||||||
|
@ -100,20 +118,6 @@ in {
|
||||||
noto-fonts-monochrome-emoji
|
noto-fonts-monochrome-emoji
|
||||||
font-awesome
|
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}";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue