modules/locale: add fontconfig, fix types

This commit is contained in:
Infinidoge 2021-12-03 22:51:40 -05:00
parent 84c03d7152
commit 450e497cb4
2 changed files with 25 additions and 14 deletions

View file

@ -5,10 +5,20 @@ let
cfg = config.modules.locale; cfg = config.modules.locale;
in in
{ {
options.modules.locale = { options.modules.locale = with types; {
keymap = mkOpt "us"; keymap = mkOpt str "us";
locale = mkOpt "en_us.UTF-8"; locale = mkOpt str "en_us.UTF-8";
timezone = mkOpt "America/New_York"; timezone = mkOpt str "America/New_York";
fonts = {
fonts = mkOpt (listOf package) [ ];
defaults = {
serif = mkOpt (listOf str) "DejaVu Serif";
emoji = mkOpt (listOf str) "Noto Color Emoji";
monospace = mkOpt (listOf str) "DejaVu Sans Mono";
sansSerif = mkOpt (listOf str) "DejaVu Sans";
};
};
}; };
config = { config = {
@ -18,5 +28,9 @@ in
i18n.defaultLocale = cfg.locale; i18n.defaultLocale = cfg.locale;
time.timeZone = cfg.timezone; time.timeZone = cfg.timezone;
fonts.fontconfig.defaultFonts = mkAliasDefinitions options.defaults;
console.packages = cfg.fonts.fonts;
}; };
} }

View file

@ -87,18 +87,15 @@ in
steam.enable = true; steam.enable = true;
}; };
fonts = { modules = {
locale.fonts = {
fonts = with pkgs; [ fonts = with pkgs; [
(nerdfonts.override { fonts = modules.locale.fonts.defaults.monospace; })
dejavu_fonts dejavu_fonts
emacs-all-the-icons-fonts
(nerdfonts.override { fonts = [ "DejaVuSansMono" ]; })
]; ];
fontconfig = { defaults = {
enable = lib.mkDefault true;
defaultFonts = {
monospace = [ "DejaVuSansMono" ]; monospace = [ "DejaVuSansMono" ];
sansSerif = [ "DejaVu Sans" ];
}; };
}; };
}; };