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;
|
cfg = config.modules.desktop;
|
||||||
in {
|
in {
|
||||||
options.modules.desktop = {
|
options.modules.desktop = {
|
||||||
envProto = mkOption {
|
envProto = mkOption {
|
||||||
type = types.nullOr (types.enum ["x11" "wayland"]);
|
type = types.nullOr (types.enum ["x11" "wayland"]);
|
||||||
description = "What display protocol to use";
|
description = "What display protocol to use";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
config = mkMerge [
|
config = mkMerge [
|
||||||
{
|
{
|
||||||
qt = {
|
qt = {
|
||||||
enable = true;
|
enable = true;
|
||||||
platformTheme = "gnome";
|
platformTheme = "gnome";
|
||||||
style = "adwaita-dark";
|
style = "adwaita-dark";
|
||||||
};
|
};
|
||||||
|
|
||||||
modules.desktop.fonts.enable = builtins.trace "enabling fonts" true;
|
modules.desktop.fonts.enable = true;
|
||||||
modules.desktop.fonts.baseFonts = builtins.trace "enabling basefonts" true;
|
modules.desktop.fonts.baseFonts = true;
|
||||||
}
|
}
|
||||||
(mkIf (cfg.envProto == "wayland") {
|
(mkIf (cfg.envProto == "wayland") {
|
||||||
hm.home.packages = with pkgs; [ wl-clipboard-x11 ];
|
hm.home.packages = with pkgs; [ wl-clipboard-x11 ];
|
||||||
|
@ -41,7 +41,7 @@ in {
|
||||||
(mkIf (cfg.envProto == "x11") {
|
(mkIf (cfg.envProto == "x11") {
|
||||||
hm.home.packages = with pkgs; [ xclip ];
|
hm.home.packages = with pkgs; [ xclip ];
|
||||||
|
|
||||||
services.xserver.excludePackages = [ pkgs.xterm ];
|
services.xserver.excludePackages = [ pkgs.xterm ];
|
||||||
})
|
})
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,7 +2,6 @@
|
||||||
|
|
||||||
with lib;
|
with lib;
|
||||||
let
|
let
|
||||||
# ty https://github.com/Misterio77/nix-config/blob/main/modules/home-manager/fonts.nix
|
|
||||||
mkFontOption = kind: default: {
|
mkFontOption = kind: default: {
|
||||||
family = mkOption {
|
family = mkOption {
|
||||||
type = types.str;
|
type = types.str;
|
||||||
|
@ -27,16 +26,16 @@ let
|
||||||
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, containing system fonts";
|
||||||
baseFonts = mkEnableOption "Add an extra set of extra base fonts";
|
baseFonts = mkEnableOption "Add an set of extra base fonts";
|
||||||
|
|
||||||
fonts = {
|
fonts = {
|
||||||
sans = mkFontOption "sans" {
|
sansSerif = mkFontOption "sansSerif" {
|
||||||
package = pkgs.my.atkinson-hyperlegible-pro;
|
package = pkgs.my.atkinson-hyperlegible-pro;
|
||||||
family = "Atkinson Hyperlegible Pro";
|
family = "Atkinson Hyperlegible Pro";
|
||||||
|
|
||||||
size = 11;
|
size = 11;
|
||||||
};
|
};
|
||||||
sansSerif = mkFontOption "sans-serif" {
|
serif = mkFontOption "serif" {
|
||||||
package = pkgs.my.atkinson-hyperlegible-pro;
|
package = pkgs.my.atkinson-hyperlegible-pro;
|
||||||
family = "Atkinson Hyperlegible Pro";
|
family = "Atkinson Hyperlegible Pro";
|
||||||
|
|
||||||
|
@ -68,8 +67,8 @@ in {
|
||||||
fontDir.enable = true;
|
fontDir.enable = true;
|
||||||
fontconfig.enable = true;
|
fontconfig.enable = true;
|
||||||
fontconfig.defaultFonts = {
|
fontconfig.defaultFonts = {
|
||||||
sans = [ cfg.fonts.sans.family ];
|
|
||||||
sansSerif = [ cfg.fonts.sansSerif.family ];
|
sansSerif = [ cfg.fonts.sansSerif.family ];
|
||||||
|
serif = [ cfg.fonts.serif.family ];
|
||||||
monospace = [ cfg.fonts.monospace.family ];
|
monospace = [ cfg.fonts.monospace.family ];
|
||||||
emoji = [ cfg.fonts.emoji.family ];
|
emoji = [ cfg.fonts.emoji.family ];
|
||||||
};
|
};
|
||||||
|
@ -80,38 +79,41 @@ in {
|
||||||
noto-fonts-cjk-sans
|
noto-fonts-cjk-sans
|
||||||
liberation_ttf
|
liberation_ttf
|
||||||
] ++ [
|
] ++ [
|
||||||
cfg.fonts.sans.package
|
|
||||||
cfg.fonts.sansSerif.package
|
cfg.fonts.sansSerif.package
|
||||||
|
cfg.fonts.serif.package
|
||||||
cfg.fonts.monospace.package
|
cfg.fonts.monospace.package
|
||||||
cfg.fonts.monospaceBitmap.package
|
cfg.fonts.monospaceBitmap.package
|
||||||
cfg.fonts.emoji.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.enable = true;
|
||||||
hm.gtk.font = {
|
hm.gtk.font = with cfg.fonts.sansSerif; { # im great at writing nix, right?
|
||||||
inherit (cfg.fonts.sans) package name size;
|
package = package;
|
||||||
|
name = family;
|
||||||
|
|
||||||
|
size = size;
|
||||||
};
|
};
|
||||||
|
|
||||||
hm.dconf.settings = {
|
hm.dconf.settings = {
|
||||||
"org/gnome/desktop/interface".font-name = with cfg.fonts.sans; "${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.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}";
|
"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.initial_rows = 40
|
||||||
|
|
||||||
config.window_frame = {
|
config.window_frame = {
|
||||||
font = wezterm.font '${fonts.sans.family}',
|
font = wezterm.font '${fonts.sansSerif.family}',
|
||||||
font_size = ${toString fonts.sans.size}
|
font_size = ${toString fonts.sansSerif.size}
|
||||||
}
|
}
|
||||||
|
|
||||||
return config
|
return config
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue