nixos-config/nixos/modules/system/font.nix

81 lines
1.4 KiB
Nix
Raw Normal View History

2019-10-24 02:20:38 +02:00
{ config, lib, pkgs, ... }:
with lib;
let
cfg = config.system.custom.fonts;
2021-11-01 09:20:42 +01:00
in
{
2019-10-24 02:20:38 +02:00
options.system.custom.fonts = {
enable = mkEnableOption "enable fonts";
dpi = mkOption {
2019-12-20 05:54:26 +01:00
type = types.int;
default = 141;
2019-10-24 02:20:38 +02:00
description = ''
dpi of the monitor
'';
};
};
2021-06-10 13:28:54 +02:00
# You can put your private ttf fonts into
# in $XDG_DATA_HOME/fonts, which for most users will resolve to ~/.local/share/fonts
# see https://nixos.wiki/wiki/Fonts
2019-10-24 02:20:38 +02:00
config = mkIf cfg.enable {
2022-01-13 13:40:18 +01:00
services.xserver.dpi = cfg.dpi;
2019-10-24 02:20:38 +02:00
fonts = {
2021-07-08 20:43:14 +02:00
enableDefaultFonts = true;
2019-10-24 02:20:38 +02:00
enableGhostscriptFonts = true;
2021-07-08 20:43:14 +02:00
fontDir.enable = true;
2019-10-24 02:20:38 +02:00
fontconfig = {
2022-01-13 13:40:18 +01:00
#dpi = cfg.dpi;
2019-10-24 02:20:38 +02:00
subpixel = {
lcdfilter = "default";
2019-12-20 05:54:26 +01:00
rgba = "rgb";
2019-10-24 02:20:38 +02:00
};
hinting = {
2019-12-20 05:54:26 +01:00
enable = true;
2019-10-24 02:20:38 +02:00
autohint = false;
};
2019-12-20 05:54:26 +01:00
enable = true;
antialias = true;
2021-07-08 20:43:14 +02:00
#defaultFonts = { monospace = [ "inconsolata" ]; };
2019-10-24 02:20:38 +02:00
};
fonts = with pkgs; [
corefonts
hasklig
inconsolata
source-code-pro
symbola
ubuntu_font_family
# symbol fonts
# ------------
2021-07-08 20:43:14 +02:00
# nerdfonts
2019-10-24 02:20:38 +02:00
powerline-fonts
2022-06-14 22:56:58 +02:00
#font-awesome-ttf
font-awesome
2019-10-24 02:20:38 +02:00
fira-code-symbols
# shell font
# ----------
terminus_font
gohufont
];
};
};
}