Merge pull request #244332 from SuperSandro2000/fonts-fonts

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

+3 -1
doc/builders/packages/ibus.section.md
···
On NixOS, it can be installed using the following expression:
```nix
-
{ pkgs, ... }: { fonts.fonts = with pkgs; [ noto-fonts-emoji ]; }
+
{ pkgs, ... }: {
+
fonts.packages = with pkgs; [ noto-fonts-emoji ];
+
}
```
+2
nixos/doc/manual/release-notes/rl-2311.section.md
···
- `buildGoModule` `go-modules` attrs have been renamed to `goModules`.
+
- The `fonts.fonts` and `fonts.enableDefaultFonts` options have been renamed to `fonts.packages` and `fonts.enableDefaultPackages` respectively.
+
- `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.
- 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
···
# looking things up.
makeCacheConf = { }:
let
-
makeCache = fontconfig: pkgs.makeFontsCache { inherit fontconfig; fontDirectories = config.fonts.fonts; };
+
makeCache = fontconfig: pkgs.makeFontsCache { inherit fontconfig; fontDirectories = config.fonts.packages; };
cache = makeCache pkgs.fontconfig;
cache32 = makeCache pkgs.pkgsi686Linux.fontconfig;
in
···
<!DOCTYPE fontconfig SYSTEM 'urn:fontconfig:fonts.dtd'>
<fontconfig>
<!-- Font directories -->
-
${concatStringsSep "\n" (map (font: "<dir>${font}</dir>") config.fonts.fonts)}
+
${concatStringsSep "\n" (map (font: "<dir>${font}</dir>") config.fonts.packages)}
${optionalString (pkgs.stdenv.hostPlatform == pkgs.stdenv.buildPlatform) ''
<!-- Pre-generated font caches -->
<cachedir>${cache}</cachedir>
+1 -1
nixos/modules/config/fonts/fontdir.nix
···
x11Fonts = pkgs.runCommand "X11-fonts" { preferLocalBuild = true; } ''
mkdir -p "$out/share/X11/fonts"
font_regexp='.*\.\(ttf\|ttc\|otb\|otf\|pcf\|pfa\|pfb\|bdf\)\(\.gz\)?'
-
find ${toString config.fonts.fonts} -regex "$font_regexp" \
+
find ${toString config.fonts.packages} -regex "$font_regexp" \
-exec ln -sf -t "$out/share/X11/fonts" '{}' \;
cd "$out/share/X11/fonts"
${optionalString cfg.decompressFonts ''
-47
nixos/modules/config/fonts/fonts.nix
···
-
{ config, lib, pkgs, ... }:
-
-
with lib;
-
-
let
-
cfg = config.fonts;
-
-
defaultFonts =
-
[ pkgs.dejavu_fonts
-
pkgs.freefont_ttf
-
pkgs.gyre-fonts # TrueType substitutes for standard PostScript fonts
-
pkgs.liberation_ttf
-
pkgs.unifont
-
pkgs.noto-fonts-emoji
-
];
-
in
-
{
-
imports = [
-
(mkRemovedOptionModule [ "fonts" "enableCoreFonts" ] "Use fonts.fonts = [ pkgs.corefonts ]; instead.")
-
];
-
-
options = {
-
-
fonts = {
-
-
# TODO: find another name for it.
-
fonts = mkOption {
-
type = types.listOf types.path;
-
default = [];
-
example = literalExpression "[ pkgs.dejavu_fonts ]";
-
description = lib.mdDoc "List of primary font paths.";
-
};
-
-
enableDefaultFonts = mkOption {
-
type = types.bool;
-
default = false;
-
description = lib.mdDoc ''
-
Enable a basic set of fonts providing several font styles
-
and families and reasonable coverage of Unicode.
-
'';
-
};
-
};
-
-
};
-
-
config = { fonts.fonts = mkIf cfg.enableDefaultFonts defaultFonts; };
-
}
+10 -20
nixos/modules/config/fonts/ghostscript.nix
···
with lib;
{
-
options = {
-
-
fonts = {
-
-
enableGhostscriptFonts = mkOption {
-
type = types.bool;
-
default = false;
-
description = lib.mdDoc ''
-
Whether to add the fonts provided by Ghostscript (such as
-
various URW fonts and the “Base-14” Postscript fonts) to the
-
list of system fonts, making them available to X11
-
applications.
-
'';
-
};
-
+
fonts.enableGhostscriptFonts = mkOption {
+
type = types.bool;
+
default = false;
+
description = lib.mdDoc ''
+
Whether to add the fonts provided by Ghostscript (such as
+
various URW fonts and the “Base-14” Postscript fonts) to the
+
list of system fonts, making them available to X11
+
applications.
+
'';
};
};
-
config = mkIf config.fonts.enableGhostscriptFonts {
-
-
fonts.fonts = [ "${pkgs.ghostscript}/share/ghostscript/fonts" ];
-
+
fonts.packages = [ "${pkgs.ghostscript}/share/ghostscript/fonts" ];
};
-
}
+43
nixos/modules/config/fonts/packages.nix
···
+
{ config, lib, pkgs, ... }:
+
+
let
+
cfg = config.fonts;
+
in
+
{
+
imports = [
+
(lib.mkRemovedOptionModule [ "fonts" "enableCoreFonts" ] "Use fonts.packages = [ pkgs.corefonts ]; instead.")
+
(lib.mkRenamedOptionModule [ "fonts" "enableDefaultFonts " ] [ "fonts" "enableDefaultPackages" ])
+
(lib.mkRenamedOptionModule [ "fonts" "fonts" ] [ "fonts" "packages" ])
+
];
+
+
options = {
+
fonts = {
+
packages = lib.mkOption {
+
type = with lib.types; listOf path;
+
default = [];
+
example = lib.literalExpression "[ pkgs.dejavu_fonts ]";
+
description = lib.mdDoc "List of primary font packages.";
+
};
+
+
enableDefaultPackages = lib.mkOption {
+
type = lib.types.bool;
+
default = false;
+
description = lib.mdDoc ''
+
Enable a basic set of fonts providing several styles
+
and families and reasonable coverage of Unicode.
+
'';
+
};
+
};
+
};
+
+
config = {
+
fonts.packages = lib.mkIf cfg.enableDefaultPackages (with pkgs; [
+
dejavu_fonts
+
freefont_ttf
+
gyre-fonts # TrueType substitutes for standard PostScript fonts
+
liberation_ttf
+
unifont
+
noto-fonts-emoji
+
]);
+
};
+
}
+1 -1
nixos/modules/module-list.nix
···
./config/debug-info.nix
./config/fonts/fontconfig.nix
./config/fonts/fontdir.nix
-
./config/fonts/fonts.nix
./config/fonts/ghostscript.nix
+
./config/fonts/packages.nix
./config/gnu.nix
./config/gtk/gtk-icon-cache.nix
./config/i18n.nix
+1 -1
nixos/modules/programs/hyprland.nix
···
config = mkIf cfg.enable {
environment.systemPackages = [ cfg.finalPackage ];
-
fonts.enableDefaultFonts = mkDefault true;
+
fonts.enableDefaultPackages = mkDefault true;
hardware.opengl.enable = mkDefault true;
programs = {
+1 -1
nixos/modules/programs/miriway.nix
···
};
hardware.opengl.enable = lib.mkDefault true;
-
fonts.enableDefaultFonts = lib.mkDefault true;
+
fonts.enableDefaultPackages = lib.mkDefault true;
programs.dconf.enable = lib.mkDefault true;
programs.xwayland.enable = lib.mkDefault true;
+1 -1
nixos/modules/programs/wayland/wayland-session.nix
···
};
hardware.opengl.enable = mkDefault true;
-
fonts.enableDefaultFonts = mkDefault true;
+
fonts.enableDefaultPackages = mkDefault true;
programs = {
dconf.enable = mkDefault true;
+1 -1
nixos/modules/services/monitoring/munin.nix
···
# Munin is hardcoded to use DejaVu Mono and the graphs come out wrong if
# it's not available.
-
fonts.fonts = [ pkgs.dejavu_fonts ];
+
fonts.packages = [ pkgs.dejavu_fonts ];
systemd.timers.munin-cron = {
description = "batch Munin master programs";
+1 -1
nixos/modules/services/networking/xrdp.nix
···
icons.enable = true;
};
-
fonts.enableDefaultFonts = mkDefault true;
+
fonts.enableDefaultPackages = mkDefault true;
systemd = {
services.xrdp = {
+1 -1
nixos/modules/services/ttys/kmscon.nix
···
fonts = mkIf (cfg.fonts != null) {
fontconfig.enable = true;
-
fonts = map (f: f.package) cfg.fonts;
+
packages = map (f: f.package) cfg.fonts;
};
};
}
+1 -1
nixos/modules/services/x11/desktop-managers/budgie.nix
···
++ cfg.sessionPath;
# Fonts.
-
fonts.fonts = mkDefault [
+
fonts.packages = mkDefault [
pkgs.noto-fonts
pkgs.hack-font
];
+1 -1
nixos/modules/services/x11/desktop-managers/cinnamon.nix
···
qt.style = "adwaita";
# Default Fonts
-
fonts.fonts = with pkgs; [
+
fonts.packages = with pkgs; [
source-code-pro # Default monospace font in 3.32
ubuntu_font_family # required for default theme
];
+1 -1
nixos/modules/services/x11/desktop-managers/deepin.nix
···
networking.networkmanager.enable = mkDefault true;
programs.dconf.enable = mkDefault true;
-
fonts.fonts = with pkgs; [ noto-fonts ];
+
fonts.packages = with pkgs; [ noto-fonts ];
xdg.mime.enable = true;
xdg.menus.enable = true;
xdg.icons.enable = true;
+1 -1
nixos/modules/services/x11/desktop-managers/enlightenment.nix
···
environment.etc."X11/xkb".source = xcfg.xkbDir;
-
fonts.fonts = [ pkgs.dejavu_fonts pkgs.ubuntu_font_family ];
+
fonts.packages = [ pkgs.dejavu_fonts pkgs.ubuntu_font_family ];
services.udisks2.enable = true;
services.upower.enable = config.powerManagement.enable;
+1 -1
nixos/modules/services/x11/desktop-managers/gnome.nix
···
isSystem = true;
};
-
fonts.fonts = with pkgs; [
+
fonts.packages = with pkgs; [
cantarell-fonts
dejavu_fonts
source-code-pro # Default monospace font in 3.32
+2 -2
nixos/modules/services/x11/desktop-managers/pantheon.nix
···
qt.style = "adwaita";
# Default Fonts
-
fonts.fonts = with pkgs; [
+
fonts.packages = with pkgs; [
inter
open-dyslexic
open-sans
···
])) config.environment.pantheon.excludePackages;
# needed by screenshot
-
fonts.fonts = [
+
fonts.packages = [
pkgs.pantheon.elementary-redacted-script
];
})
+1 -1
nixos/modules/services/x11/desktop-managers/plasma5.nix
···
# Enable GTK applications to load SVG icons
services.xserver.gdk-pixbuf.modulePackages = [ pkgs.librsvg ];
-
fonts.fonts = with pkgs; [ cfg.notoPackage hack-font ];
+
fonts.packages = with pkgs; [ cfg.notoPackage hack-font ];
fonts.fontconfig.defaultFonts = {
monospace = [ "Hack" "Noto Sans Mono" ];
sansSerif = [ "Noto Sans" ];
+1 -1
nixos/modules/services/x11/display-managers/lightdm-greeters/slick.nix
···
theme
];
-
fonts.fonts = [ font ];
+
fonts.packages = [ font ];
environment.etc."lightdm/slick-greeter.conf".source = slickGreeterConf;
};
+3 -3
nixos/modules/services/x11/xserver.nix
···
};
fontsForXServer =
-
config.fonts.fonts ++
+
config.fonts.packages ++
# We don't want these fonts in fonts.conf, because then modern,
# fontconfig-based applications will get horrible bitmapped
# Helvetica fonts. It's better to get a substitution (like Nimbus
···
${cfg.extraConfig}
'';
-
fonts.enableDefaultFonts = mkDefault true;
-
fonts.fonts = [
+
fonts.enableDefaultPackages = mkDefault true;
+
fonts.packages = [
(if cfg.upscaleDefaultCursor then fontcursormisc_hidpi else pkgs.xorg.fontcursormisc)
pkgs.xorg.fontmiscmisc
];
+1 -1
nixos/tests/cage.nix
···
{
imports = [ ./common/user-account.nix ];
-
fonts.fonts = with pkgs; [ dejavu_fonts ];
+
fonts.packages = with pkgs; [ dejavu_fonts ];
services.cage = {
enable = true;
+1 -1
nixos/tests/cups-pdf.nix
···
nodes.machine = { pkgs, ... }: {
imports = [ ./common/user-account.nix ];
environment.systemPackages = [ pkgs.poppler_utils ];
-
fonts.fonts = [ pkgs.dejavu_fonts ]; # yields more OCR-able pdf
+
fonts.packages = [ pkgs.dejavu_fonts ]; # yields more OCR-able pdf
services.printing.cups-pdf.enable = true;
services.printing.cups-pdf.instances = {
opt = {};
+2 -2
nixos/tests/fontconfig-default-fonts.nix
···
];
nodes.machine = { config, pkgs, ... }: {
-
fonts.enableDefaultFonts = true; # Background fonts
-
fonts.fonts = with pkgs; [
+
fonts.enableDefaultPackages = true; # Background fonts
+
fonts.packages = with pkgs; [
noto-fonts-emoji
cantarell-fonts
twitter-color-emoji
+1 -1
nixos/tests/miriway.nix
···
};
};
-
fonts.fonts = [ pkgs.inconsolata ];
+
fonts.packages = [ pkgs.inconsolata ];
};
enableOCR = true;
+1 -1
nixos/tests/noto-fonts-cjk-qt-default-weight.nix
···
nodes.machine = {
imports = [ ./common/x11.nix ];
fonts = {
-
enableDefaultFonts = false;
+
enableDefaultPackages = false;
fonts = [ pkgs.noto-fonts-cjk-sans ];
};
};
+1 -1
nixos/tests/noto-fonts.nix
···
imports = [ ./common/x11.nix ];
environment.systemPackages = [ pkgs.gedit ];
fonts = {
-
enableDefaultFonts = false;
+
enableDefaultPackages = false;
fonts = with pkgs;[
noto-fonts
noto-fonts-cjk-sans
+1 -1
nixos/tests/sway.nix
···
'';
};
-
fonts.fonts = [ pkgs.inconsolata ];
+
fonts.packages = [ pkgs.inconsolata ];
# Automatically configure and start Sway when logging in on tty1:
programs.bash.loginShellInit = ''
+1 -1
nixos/tests/vscodium.nix
···
environment.variables.NIXOS_OZONE_WL = "1";
environment.variables.DISPLAY = "do not use";
-
fonts.fonts = with pkgs; [ dejavu_fonts ];
+
fonts.packages = with pkgs; [ dejavu_fonts ];
};
xorg = { pkgs, ... }: {
imports = [ ./common/user-account.nix ./common/x11.nix ];
+1 -1
pkgs/tools/typesetting/tex/texlive/combine.nix
···
passthru = {
# This is set primarily to help find-tarballs.nix to do its job
packages = pkgList.all;
-
# useful for inclusion in the `fonts.fonts` nixos option or for use in devshells
+
# useful for inclusion in the `fonts.packages` nixos option or for use in devshells
fonts = "${texmfroot}/texmf-dist/fonts";
};