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

31 lines
706 B
Nix
Raw Normal View History

2024-03-21 15:00:36 +01:00
{ options, config, pkgs, lib, ... }:
with lib;
with lib.metacfg;
let cfg = config.metacfg.system.fonts;
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;
};
};
}