at 23.11-beta 1.2 kB view raw
1{ config, lib, pkgs, ... }: 2 3let 4 cfg = config.fonts; 5in 6{ 7 imports = [ 8 (lib.mkRemovedOptionModule [ "fonts" "enableCoreFonts" ] "Use fonts.packages = [ pkgs.corefonts ]; instead.") 9 (lib.mkRenamedOptionModule [ "fonts" "enableDefaultFonts" ] [ "fonts" "enableDefaultPackages" ]) 10 (lib.mkRenamedOptionModule [ "fonts" "fonts" ] [ "fonts" "packages" ]) 11 ]; 12 13 options = { 14 fonts = { 15 packages = lib.mkOption { 16 type = with lib.types; listOf path; 17 default = []; 18 example = lib.literalExpression "[ pkgs.dejavu_fonts ]"; 19 description = lib.mdDoc "List of primary font packages."; 20 }; 21 22 enableDefaultPackages = lib.mkOption { 23 type = lib.types.bool; 24 default = false; 25 description = lib.mdDoc '' 26 Enable a basic set of fonts providing several styles 27 and families and reasonable coverage of Unicode. 28 ''; 29 }; 30 }; 31 }; 32 33 config = { 34 fonts.packages = lib.mkIf cfg.enableDefaultPackages (with pkgs; [ 35 dejavu_fonts 36 freefont_ttf 37 gyre-fonts # TrueType substitutes for standard PostScript fonts 38 liberation_ttf 39 unifont 40 noto-fonts-color-emoji 41 ]); 42 }; 43}