Merge pull request #244332 from SuperSandro2000/fonts-fonts

nixos/fonts: rename fonts.fonts option to fonts.packages, other cleanups

authored by asymmetric and committed by GitHub 46df012d 9516089c

+90 -100
+3 -1
doc/builders/packages/ibus.section.md
··· 34 34 On NixOS, it can be installed using the following expression: 35 35 36 36 ```nix 37 - { pkgs, ... }: { fonts.fonts = with pkgs; [ noto-fonts-emoji ]; } 37 + { pkgs, ... }: { 38 + fonts.packages = with pkgs; [ noto-fonts-emoji ]; 39 + } 38 40 ```
+2
nixos/doc/manual/release-notes/rl-2311.section.md
··· 123 123 124 124 - `buildGoModule` `go-modules` attrs have been renamed to `goModules`. 125 125 126 + - The `fonts.fonts` and `fonts.enableDefaultFonts` options have been renamed to `fonts.packages` and `fonts.enableDefaultPackages` respectively. 127 + 126 128 - `services.fail2ban.jails` can now be configured with attribute sets defining settings and filters instead of lines. The stringed options `daemonConfig` and `extraSettings` have respectively been replaced by `daemonSettings` and `jails.DEFAULT.settings` which use attribute sets. 127 129 128 130 - The module [services.ankisyncd](#opt-services.ankisyncd.package) has been switched to [anki-sync-server-rs](https://github.com/ankicommunity/anki-sync-server-rs) from the old python version, which was difficult to update, had not been updated in a while, and did not support recent versions of anki.
+2 -2
nixos/modules/config/fonts/fontconfig.nix
··· 42 42 # looking things up. 43 43 makeCacheConf = { }: 44 44 let 45 - makeCache = fontconfig: pkgs.makeFontsCache { inherit fontconfig; fontDirectories = config.fonts.fonts; }; 45 + makeCache = fontconfig: pkgs.makeFontsCache { inherit fontconfig; fontDirectories = config.fonts.packages; }; 46 46 cache = makeCache pkgs.fontconfig; 47 47 cache32 = makeCache pkgs.pkgsi686Linux.fontconfig; 48 48 in ··· 51 51 <!DOCTYPE fontconfig SYSTEM 'urn:fontconfig:fonts.dtd'> 52 52 <fontconfig> 53 53 <!-- Font directories --> 54 - ${concatStringsSep "\n" (map (font: "<dir>${font}</dir>") config.fonts.fonts)} 54 + ${concatStringsSep "\n" (map (font: "<dir>${font}</dir>") config.fonts.packages)} 55 55 ${optionalString (pkgs.stdenv.hostPlatform == pkgs.stdenv.buildPlatform) '' 56 56 <!-- Pre-generated font caches --> 57 57 <cachedir>${cache}</cachedir>
+1 -1
nixos/modules/config/fonts/fontdir.nix
··· 9 9 x11Fonts = pkgs.runCommand "X11-fonts" { preferLocalBuild = true; } '' 10 10 mkdir -p "$out/share/X11/fonts" 11 11 font_regexp='.*\.\(ttf\|ttc\|otb\|otf\|pcf\|pfa\|pfb\|bdf\)\(\.gz\)?' 12 - find ${toString config.fonts.fonts} -regex "$font_regexp" \ 12 + find ${toString config.fonts.packages} -regex "$font_regexp" \ 13 13 -exec ln -sf -t "$out/share/X11/fonts" '{}' \; 14 14 cd "$out/share/X11/fonts" 15 15 ${optionalString cfg.decompressFonts ''
-47
nixos/modules/config/fonts/fonts.nix
··· 1 - { config, lib, pkgs, ... }: 2 - 3 - with lib; 4 - 5 - let 6 - cfg = config.fonts; 7 - 8 - defaultFonts = 9 - [ pkgs.dejavu_fonts 10 - pkgs.freefont_ttf 11 - pkgs.gyre-fonts # TrueType substitutes for standard PostScript fonts 12 - pkgs.liberation_ttf 13 - pkgs.unifont 14 - pkgs.noto-fonts-emoji 15 - ]; 16 - in 17 - { 18 - imports = [ 19 - (mkRemovedOptionModule [ "fonts" "enableCoreFonts" ] "Use fonts.fonts = [ pkgs.corefonts ]; instead.") 20 - ]; 21 - 22 - options = { 23 - 24 - fonts = { 25 - 26 - # TODO: find another name for it. 27 - fonts = mkOption { 28 - type = types.listOf types.path; 29 - default = []; 30 - example = literalExpression "[ pkgs.dejavu_fonts ]"; 31 - description = lib.mdDoc "List of primary font paths."; 32 - }; 33 - 34 - enableDefaultFonts = mkOption { 35 - type = types.bool; 36 - default = false; 37 - description = lib.mdDoc '' 38 - Enable a basic set of fonts providing several font styles 39 - and families and reasonable coverage of Unicode. 40 - ''; 41 - }; 42 - }; 43 - 44 - }; 45 - 46 - config = { fonts.fonts = mkIf cfg.enableDefaultFonts defaultFonts; }; 47 - }
+10 -20
nixos/modules/config/fonts/ghostscript.nix
··· 3 3 with lib; 4 4 5 5 { 6 - 7 6 options = { 8 - 9 - fonts = { 10 - 11 - enableGhostscriptFonts = mkOption { 12 - type = types.bool; 13 - default = false; 14 - description = lib.mdDoc '' 15 - Whether to add the fonts provided by Ghostscript (such as 16 - various URW fonts and the “Base-14” Postscript fonts) to the 17 - list of system fonts, making them available to X11 18 - applications. 19 - ''; 20 - }; 21 - 7 + fonts.enableGhostscriptFonts = mkOption { 8 + type = types.bool; 9 + default = false; 10 + description = lib.mdDoc '' 11 + Whether to add the fonts provided by Ghostscript (such as 12 + various URW fonts and the “Base-14” Postscript fonts) to the 13 + list of system fonts, making them available to X11 14 + applications. 15 + ''; 22 16 }; 23 17 24 18 }; 25 19 26 - 27 20 config = mkIf config.fonts.enableGhostscriptFonts { 28 - 29 - fonts.fonts = [ "${pkgs.ghostscript}/share/ghostscript/fonts" ]; 30 - 21 + fonts.packages = [ "${pkgs.ghostscript}/share/ghostscript/fonts" ]; 31 22 }; 32 - 33 23 }
+43
nixos/modules/config/fonts/packages.nix
··· 1 + { config, lib, pkgs, ... }: 2 + 3 + let 4 + cfg = config.fonts; 5 + in 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-emoji 41 + ]); 42 + }; 43 + }
+1 -1
nixos/modules/module-list.nix
··· 4 4 ./config/debug-info.nix 5 5 ./config/fonts/fontconfig.nix 6 6 ./config/fonts/fontdir.nix 7 - ./config/fonts/fonts.nix 8 7 ./config/fonts/ghostscript.nix 8 + ./config/fonts/packages.nix 9 9 ./config/gnu.nix 10 10 ./config/gtk/gtk-icon-cache.nix 11 11 ./config/i18n.nix
+1 -1
nixos/modules/programs/hyprland.nix
··· 60 60 config = mkIf cfg.enable { 61 61 environment.systemPackages = [ cfg.finalPackage ]; 62 62 63 - fonts.enableDefaultFonts = mkDefault true; 63 + fonts.enableDefaultPackages = mkDefault true; 64 64 hardware.opengl.enable = mkDefault true; 65 65 66 66 programs = {
+1 -1
nixos/modules/programs/miriway.nix
··· 66 66 }; 67 67 68 68 hardware.opengl.enable = lib.mkDefault true; 69 - fonts.enableDefaultFonts = lib.mkDefault true; 69 + fonts.enableDefaultPackages = lib.mkDefault true; 70 70 programs.dconf.enable = lib.mkDefault true; 71 71 programs.xwayland.enable = lib.mkDefault true; 72 72
+1 -1
nixos/modules/programs/wayland/wayland-session.nix
··· 5 5 }; 6 6 7 7 hardware.opengl.enable = mkDefault true; 8 - fonts.enableDefaultFonts = mkDefault true; 8 + fonts.enableDefaultPackages = mkDefault true; 9 9 10 10 programs = { 11 11 dconf.enable = mkDefault true;
+1 -1
nixos/modules/services/monitoring/munin.nix
··· 375 375 376 376 # Munin is hardcoded to use DejaVu Mono and the graphs come out wrong if 377 377 # it's not available. 378 - fonts.fonts = [ pkgs.dejavu_fonts ]; 378 + fonts.packages = [ pkgs.dejavu_fonts ]; 379 379 380 380 systemd.timers.munin-cron = { 381 381 description = "batch Munin master programs";
+1 -1
nixos/modules/services/networking/xrdp.nix
··· 121 121 icons.enable = true; 122 122 }; 123 123 124 - fonts.enableDefaultFonts = mkDefault true; 124 + fonts.enableDefaultPackages = mkDefault true; 125 125 126 126 systemd = { 127 127 services.xrdp = {
+1 -1
nixos/modules/services/ttys/kmscon.nix
··· 111 111 112 112 fonts = mkIf (cfg.fonts != null) { 113 113 fontconfig.enable = true; 114 - fonts = map (f: f.package) cfg.fonts; 114 + packages = map (f: f.package) cfg.fonts; 115 115 }; 116 116 }; 117 117 }
+1 -1
nixos/modules/services/x11/desktop-managers/budgie.nix
··· 156 156 ++ cfg.sessionPath; 157 157 158 158 # Fonts. 159 - fonts.fonts = mkDefault [ 159 + fonts.packages = mkDefault [ 160 160 pkgs.noto-fonts 161 161 pkgs.hack-font 162 162 ];
+1 -1
nixos/modules/services/x11/desktop-managers/cinnamon.nix
··· 218 218 qt.style = "adwaita"; 219 219 220 220 # Default Fonts 221 - fonts.fonts = with pkgs; [ 221 + fonts.packages = with pkgs; [ 222 222 source-code-pro # Default monospace font in 3.32 223 223 ubuntu_font_family # required for default theme 224 224 ];
+1 -1
nixos/modules/services/x11/desktop-managers/deepin.nix
··· 67 67 networking.networkmanager.enable = mkDefault true; 68 68 programs.dconf.enable = mkDefault true; 69 69 70 - fonts.fonts = with pkgs; [ noto-fonts ]; 70 + fonts.packages = with pkgs; [ noto-fonts ]; 71 71 xdg.mime.enable = true; 72 72 xdg.menus.enable = true; 73 73 xdg.icons.enable = true;
+1 -1
nixos/modules/services/x11/desktop-managers/enlightenment.nix
··· 92 92 93 93 environment.etc."X11/xkb".source = xcfg.xkbDir; 94 94 95 - fonts.fonts = [ pkgs.dejavu_fonts pkgs.ubuntu_font_family ]; 95 + fonts.packages = [ pkgs.dejavu_fonts pkgs.ubuntu_font_family ]; 96 96 97 97 services.udisks2.enable = true; 98 98 services.upower.enable = config.powerManagement.enable;
+1 -1
nixos/modules/services/x11/desktop-managers/gnome.nix
··· 432 432 isSystem = true; 433 433 }; 434 434 435 - fonts.fonts = with pkgs; [ 435 + fonts.packages = with pkgs; [ 436 436 cantarell-fonts 437 437 dejavu_fonts 438 438 source-code-pro # Default monospace font in 3.32
+2 -2
nixos/modules/services/x11/desktop-managers/pantheon.nix
··· 265 265 qt.style = "adwaita"; 266 266 267 267 # Default Fonts 268 - fonts.fonts = with pkgs; [ 268 + fonts.packages = with pkgs; [ 269 269 inter 270 270 open-dyslexic 271 271 open-sans ··· 306 306 ])) config.environment.pantheon.excludePackages; 307 307 308 308 # needed by screenshot 309 - fonts.fonts = [ 309 + fonts.packages = [ 310 310 pkgs.pantheon.elementary-redacted-script 311 311 ]; 312 312 })
+1 -1
nixos/modules/services/x11/desktop-managers/plasma5.nix
··· 332 332 # Enable GTK applications to load SVG icons 333 333 services.xserver.gdk-pixbuf.modulePackages = [ pkgs.librsvg ]; 334 334 335 - fonts.fonts = with pkgs; [ cfg.notoPackage hack-font ]; 335 + fonts.packages = with pkgs; [ cfg.notoPackage hack-font ]; 336 336 fonts.fontconfig.defaultFonts = { 337 337 monospace = [ "Hack" "Noto Sans Mono" ]; 338 338 sansSerif = [ "Noto Sans" ];
+1 -1
nixos/modules/services/x11/display-managers/lightdm-greeters/slick.nix
··· 142 142 theme 143 143 ]; 144 144 145 - fonts.fonts = [ font ]; 145 + fonts.packages = [ font ]; 146 146 147 147 environment.etc."lightdm/slick-greeter.conf".source = slickGreeterConf; 148 148 };
+3 -3
nixos/modules/services/x11/xserver.nix
··· 22 22 }; 23 23 24 24 fontsForXServer = 25 - config.fonts.fonts ++ 25 + config.fonts.packages ++ 26 26 # We don't want these fonts in fonts.conf, because then modern, 27 27 # fontconfig-based applications will get horrible bitmapped 28 28 # Helvetica fonts. It's better to get a substitution (like Nimbus ··· 883 883 ${cfg.extraConfig} 884 884 ''; 885 885 886 - fonts.enableDefaultFonts = mkDefault true; 887 - fonts.fonts = [ 886 + fonts.enableDefaultPackages = mkDefault true; 887 + fonts.packages = [ 888 888 (if cfg.upscaleDefaultCursor then fontcursormisc_hidpi else pkgs.xorg.fontcursormisc) 889 889 pkgs.xorg.fontmiscmisc 890 890 ];
+1 -1
nixos/tests/cage.nix
··· 11 11 { 12 12 imports = [ ./common/user-account.nix ]; 13 13 14 - fonts.fonts = with pkgs; [ dejavu_fonts ]; 14 + fonts.packages = with pkgs; [ dejavu_fonts ]; 15 15 16 16 services.cage = { 17 17 enable = true;
+1 -1
nixos/tests/cups-pdf.nix
··· 4 4 nodes.machine = { pkgs, ... }: { 5 5 imports = [ ./common/user-account.nix ]; 6 6 environment.systemPackages = [ pkgs.poppler_utils ]; 7 - fonts.fonts = [ pkgs.dejavu_fonts ]; # yields more OCR-able pdf 7 + fonts.packages = [ pkgs.dejavu_fonts ]; # yields more OCR-able pdf 8 8 services.printing.cups-pdf.enable = true; 9 9 services.printing.cups-pdf.instances = { 10 10 opt = {};
+2 -2
nixos/tests/fontconfig-default-fonts.nix
··· 7 7 ]; 8 8 9 9 nodes.machine = { config, pkgs, ... }: { 10 - fonts.enableDefaultFonts = true; # Background fonts 11 - fonts.fonts = with pkgs; [ 10 + fonts.enableDefaultPackages = true; # Background fonts 11 + fonts.packages = with pkgs; [ 12 12 noto-fonts-emoji 13 13 cantarell-fonts 14 14 twitter-color-emoji
+1 -1
nixos/tests/miriway.nix
··· 83 83 }; 84 84 }; 85 85 86 - fonts.fonts = [ pkgs.inconsolata ]; 86 + fonts.packages = [ pkgs.inconsolata ]; 87 87 }; 88 88 89 89 enableOCR = true;
+1 -1
nixos/tests/noto-fonts-cjk-qt-default-weight.nix
··· 5 5 nodes.machine = { 6 6 imports = [ ./common/x11.nix ]; 7 7 fonts = { 8 - enableDefaultFonts = false; 8 + enableDefaultPackages = false; 9 9 fonts = [ pkgs.noto-fonts-cjk-sans ]; 10 10 }; 11 11 };
+1 -1
nixos/tests/noto-fonts.nix
··· 6 6 imports = [ ./common/x11.nix ]; 7 7 environment.systemPackages = [ pkgs.gedit ]; 8 8 fonts = { 9 - enableDefaultFonts = false; 9 + enableDefaultPackages = false; 10 10 fonts = with pkgs;[ 11 11 noto-fonts 12 12 noto-fonts-cjk-sans
+1 -1
nixos/tests/sway.nix
··· 51 51 ''; 52 52 }; 53 53 54 - fonts.fonts = [ pkgs.inconsolata ]; 54 + fonts.packages = [ pkgs.inconsolata ]; 55 55 56 56 # Automatically configure and start Sway when logging in on tty1: 57 57 programs.bash.loginShellInit = ''
+1 -1
nixos/tests/vscodium.nix
··· 8 8 environment.variables.NIXOS_OZONE_WL = "1"; 9 9 environment.variables.DISPLAY = "do not use"; 10 10 11 - fonts.fonts = with pkgs; [ dejavu_fonts ]; 11 + fonts.packages = with pkgs; [ dejavu_fonts ]; 12 12 }; 13 13 xorg = { pkgs, ... }: { 14 14 imports = [ ./common/user-account.nix ./common/x11.nix ];
+1 -1
pkgs/tools/typesetting/tex/texlive/combine.nix
··· 103 103 passthru = { 104 104 # This is set primarily to help find-tarballs.nix to do its job 105 105 packages = pkgList.all; 106 - # useful for inclusion in the `fonts.fonts` nixos option or for use in devshells 106 + # useful for inclusion in the `fonts.packages` nixos option or for use in devshells 107 107 fonts = "${texmfroot}/texmf-dist/fonts"; 108 108 }; 109 109