fonts may or may not be fixed
This commit is contained in:
parent
a6db96fb0a
commit
4465048b41
3 changed files with 41 additions and 39 deletions
|
@ -5,22 +5,22 @@ let
|
|||
cfg = config.modules.desktop;
|
||||
in {
|
||||
options.modules.desktop = {
|
||||
envProto = mkOption {
|
||||
type = types.nullOr (types.enum ["x11" "wayland"]);
|
||||
description = "What display protocol to use";
|
||||
};
|
||||
envProto = mkOption {
|
||||
type = types.nullOr (types.enum ["x11" "wayland"]);
|
||||
description = "What display protocol to use";
|
||||
};
|
||||
};
|
||||
|
||||
config = mkMerge [
|
||||
{
|
||||
qt = {
|
||||
enable = true;
|
||||
platformTheme = "gnome";
|
||||
style = "adwaita-dark";
|
||||
enable = true;
|
||||
platformTheme = "gnome";
|
||||
style = "adwaita-dark";
|
||||
};
|
||||
|
||||
modules.desktop.fonts.enable = builtins.trace "enabling fonts" true;
|
||||
modules.desktop.fonts.baseFonts = builtins.trace "enabling basefonts" true;
|
||||
modules.desktop.fonts.enable = true;
|
||||
modules.desktop.fonts.baseFonts = true;
|
||||
}
|
||||
(mkIf (cfg.envProto == "wayland") {
|
||||
hm.home.packages = with pkgs; [ wl-clipboard-x11 ];
|
||||
|
@ -41,7 +41,7 @@ in {
|
|||
(mkIf (cfg.envProto == "x11") {
|
||||
hm.home.packages = with pkgs; [ xclip ];
|
||||
|
||||
services.xserver.excludePackages = [ pkgs.xterm ];
|
||||
services.xserver.excludePackages = [ pkgs.xterm ];
|
||||
})
|
||||
];
|
||||
}
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
|
||||
with lib;
|
||||
let
|
||||
# ty https://github.com/Misterio77/nix-config/blob/main/modules/home-manager/fonts.nix
|
||||
mkFontOption = kind: default: {
|
||||
family = mkOption {
|
||||
type = types.str;
|
||||
|
@ -27,16 +26,16 @@ let
|
|||
in {
|
||||
options.modules.desktop.fonts = {
|
||||
enable = mkEnableOption "Enable the font configuration module, containing system fonts";
|
||||
baseFonts = mkEnableOption "Add an extra set of extra base fonts";
|
||||
baseFonts = mkEnableOption "Add an set of extra base fonts";
|
||||
|
||||
fonts = {
|
||||
sans = mkFontOption "sans" {
|
||||
sansSerif = mkFontOption "sansSerif" {
|
||||
package = pkgs.my.atkinson-hyperlegible-pro;
|
||||
family = "Atkinson Hyperlegible Pro";
|
||||
|
||||
size = 11;
|
||||
};
|
||||
sansSerif = mkFontOption "sans-serif" {
|
||||
serif = mkFontOption "serif" {
|
||||
package = pkgs.my.atkinson-hyperlegible-pro;
|
||||
family = "Atkinson Hyperlegible Pro";
|
||||
|
||||
|
@ -68,8 +67,8 @@ in {
|
|||
fontDir.enable = true;
|
||||
fontconfig.enable = true;
|
||||
fontconfig.defaultFonts = {
|
||||
sans = [ cfg.fonts.sans.family ];
|
||||
sansSerif = [ cfg.fonts.sansSerif.family ];
|
||||
serif = [ cfg.fonts.serif.family ];
|
||||
monospace = [ cfg.fonts.monospace.family ];
|
||||
emoji = [ cfg.fonts.emoji.family ];
|
||||
};
|
||||
|
@ -80,38 +79,41 @@ in {
|
|||
noto-fonts-cjk-sans
|
||||
liberation_ttf
|
||||
] ++ [
|
||||
cfg.fonts.sans.package
|
||||
cfg.fonts.sansSerif.package
|
||||
cfg.fonts.serif.package
|
||||
cfg.fonts.monospace.package
|
||||
cfg.fonts.monospaceBitmap.package
|
||||
cfg.fonts.emoji.package
|
||||
];
|
||||
};
|
||||
} // (mkIf cfg.baseFonts {
|
||||
enableDefaultPackages = true;
|
||||
packages = with pkgs; [
|
||||
fira-code
|
||||
fira-code-symbols
|
||||
mplus-outline-fonts.githubRelease
|
||||
dina-font
|
||||
proggyfonts
|
||||
atkinson-hyperlegible
|
||||
cozette
|
||||
twemoji-color-font
|
||||
noto-fonts-color-emoji
|
||||
noto-fonts-monochrome-emoji
|
||||
font-awesome
|
||||
];
|
||||
});
|
||||
|
||||
hm.gtk.enable = true;
|
||||
hm.gtk.font = {
|
||||
inherit (cfg.fonts.sans) package name size;
|
||||
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.sans; "${family} ${toString size}";
|
||||
"org/gnome/desktop/interface".document-font-name = with cfg.fonts.sansSerif; "${family} ${toString size}";
|
||||
"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 = builtins.trace "enable = ${toString cfg.enable}, basefonts = ${toString cfg.baseFonts}" true;
|
||||
fonts.packages = with pkgs; [
|
||||
fira-code
|
||||
fira-code-symbols
|
||||
mplus-outline-fonts.githubRelease
|
||||
dina-font
|
||||
proggyfonts
|
||||
atkinson-hyperlegible
|
||||
cozette
|
||||
twemoji-color-font
|
||||
noto-fonts-color-emoji
|
||||
noto-fonts-monochrome-emoji
|
||||
font-awesome
|
||||
];
|
||||
});
|
||||
};
|
||||
}
|
||||
|
|
|
@ -31,8 +31,8 @@ in {
|
|||
config.initial_rows = 40
|
||||
|
||||
config.window_frame = {
|
||||
font = wezterm.font '${fonts.sans.family}',
|
||||
font_size = ${toString fonts.sans.size}
|
||||
font = wezterm.font '${fonts.sansSerif.family}',
|
||||
font_size = ${toString fonts.sansSerif.size}
|
||||
}
|
||||
|
||||
return config
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue