93 lines
2.7 KiB
Nix
93 lines
2.7 KiB
Nix
{
|
|
config,
|
|
lib,
|
|
pkgs,
|
|
...
|
|
}:
|
|
with lib; let
|
|
cfg = config.ezfonts;
|
|
in {
|
|
options.ezfonts = {
|
|
enable = mkEnableOption "Enable automatic fonts";
|
|
|
|
plasma = mkEnableOption "Enable automatic for plasma (using plasma-manager)";
|
|
|
|
font = mkOption {
|
|
description = "Your favourite font";
|
|
default = {};
|
|
type = types.submodule {
|
|
options = {
|
|
name = mkOption {
|
|
type = types.str;
|
|
default = "Monoid Nerd Font Mono";
|
|
description = "Name of your font";
|
|
};
|
|
package = mkOption {
|
|
type = types.package;
|
|
default = pkgs.nerd-fonts.monoid;
|
|
description = "Package for your font";
|
|
};
|
|
size = mkOption {
|
|
type = types.int;
|
|
default = 10;
|
|
description = "Size for your font";
|
|
};
|
|
};
|
|
};
|
|
};
|
|
};
|
|
|
|
config = mkMerge [
|
|
(mkIf cfg.enable {
|
|
fonts.fontconfig.enable = lib.mkDefault true;
|
|
home.packages = [cfg.font.package];
|
|
|
|
programs.vscode.userSettings = {
|
|
"editor.fontFamily" = "\"${cfg.font.name}\"";
|
|
};
|
|
|
|
gtk.font = {
|
|
package = cfg.font.package;
|
|
name = "${cfg.font.name} ${toString cfg.font.size}";
|
|
};
|
|
|
|
programs.kitty.settings = {
|
|
font_family = cfg.font.name;
|
|
font_size = cfg.font.size;
|
|
};
|
|
|
|
programs.kermit.settings = {
|
|
font = "${cfg.font.name}, normal ${toString cfg.font.size}";
|
|
};
|
|
|
|
programs.foot.settings.main.font = "${cfg.font.name}:size=${toString cfg.font.size}";
|
|
|
|
programs.rofi.font = "${cfg.font.name} ${toString cfg.font.size}";
|
|
|
|
services.mako.font = "${cfg.font.name} ${toString cfg.font.size}";
|
|
|
|
wayland.windowManager.sway.config.fonts = {
|
|
names = [cfg.font.name];
|
|
size = cfg.font.size + 0.0;
|
|
};
|
|
xsession.windowManager.i3.config.fonts = [cfg.font.name];
|
|
|
|
programs.neovim.extraConfig = ''
|
|
set guifont=${lib.replaceStrings [" "] ["\\ "] cfg.font.name}:h${toString (cfg.font.size + 0.5)}
|
|
'';
|
|
})
|
|
(mkIf (cfg.enable && cfg.plasma) {
|
|
programs.plasma.files = {
|
|
kdeglobals.General = {
|
|
fixed = "${cfg.font.name},${toString cfg.font.size},-1,5,50,0,0,0,0,0";
|
|
font = "${cfg.font.name},${toString cfg.font.size},-1,5,50,0,0,0,0,0";
|
|
menuFont = "${cfg.font.name},${toString cfg.font.size},-1,5,50,0,0,0,0,0";
|
|
smallestReadableFont = "${cfg.font.name},${toString (cfg.font.size - 2)},-1,5,50,0,0,0,0,0";
|
|
toolBarFont = "${cfg.font.name},${toString cfg.font.size},-1,5,50,0,0,0,0,0";
|
|
};
|
|
kdeglobals.WM.activeFont = "${cfg.font.name},${toString cfg.font.size},-1,5,50,0,0,0,0,0";
|
|
};
|
|
})
|
|
];
|
|
}
|