nixos-config/modules/fonts/default.nix
Erwin Boskma 4cd0f83ce8
Some checks failed
/ check (push) Failing after 2m46s
Run nixfmt
2024-02-05 11:46:52 +01:00

63 lines
1.4 KiB
Nix

{
lib,
pkgs,
config,
...
}:
with lib;
let
cfg = config.eboskma.fonts;
iosevka-buildplans = builtins.fromTOML (builtins.readFile "${pkgs.iosevka.src}/build-plans.toml");
iosevka-aile = pkgs.iosevka.override {
privateBuildPlan = iosevka-buildplans.buildPlans.iosevka-aile;
set = "aile";
};
in
{
options.eboskma.fonts = {
enable = mkEnableOption "activate fonts";
iosevka-aile = mkOption {
description = "Install Iosevka Aile";
type = types.bool;
default = true;
};
};
config = mkIf cfg.enable {
fonts = {
fontDir.enable = true;
packages =
with pkgs;
[
(nerdfonts.override {
fonts = [
"Iosevka"
"Meslo"
"Noto"
];
})
corefonts
dejavu_fonts
google-fonts
kochi-substitute
material-icons
monaspace
noto-fonts-emoji
ttf_bitstream_vera
twitter-color-emoji
]
++ lib.optional cfg.iosevka-aile iosevka-aile;
fontconfig = {
defaultFonts = {
serif = [ "Recursive Sans Casual Static Medium" ];
sansSerif = [ (if cfg.iosevka-aile then "Iosevka Aile" else "DejaVu Sans") ];
monospace = [ "Iosevka Nerd Font" ];
emoji = [ "Twitter Color Emoji" ];
};
};
};
};
}