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

77 lines
1.3 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;
in {
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 {
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 = {
2019-12-20 05:54:26 +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
font-awesome-ttf
fira-code-symbols
# shell font
# ----------
terminus_font
gohufont
];
};
};
}