nixcfg/modules/darwin/system/fonts/default.nix

40 lines
734 B
Nix
Raw Normal View History

{
options,
config,
pkgs,
lib,
...
}:
2024-03-21 15:00:36 +01:00
with lib;
with lib.metacfg;
let
cfg = config.metacfg.system.fonts;
2024-03-21 15:00:36 +01:00
in
{
options.metacfg.system.fonts = with types; {
enable = mkBoolOpt false "Whether or not to manage fonts.";
fonts = mkOpt (listOf package) [ ] "Custom font packages to install.";
};
config = mkIf cfg.enable {
environment.variables = {
# Enable icons in tooling since we have nerdfonts.
LOG_ICONS = "true";
};
fonts = {
packages =
with pkgs;
2024-03-21 15:00:36 +01:00
[
noto-fonts
noto-fonts-cjk-sans
noto-fonts-cjk-serif
noto-fonts-emoji
(nerdfonts.override { fonts = [ "Hack" ]; })
]
++ cfg.fonts;
2024-03-21 15:00:36 +01:00
};
};
}