diff --git a/nixos/doc/manual/release-notes/rl-2311.section.md b/nixos/doc/manual/release-notes/rl-2311.section.md index 52147129add..3fd8b5b6a2e 100644 --- a/nixos/doc/manual/release-notes/rl-2311.section.md +++ b/nixos/doc/manual/release-notes/rl-2311.section.md @@ -121,6 +121,8 @@ - `buildGoModule` `go-modules` attrs have been renamed to `goModules`. +- The `fonts.fonts` option has been renamed to `fonts.packages`. + - `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. diff --git a/nixos/modules/config/fonts/fonts.nix b/nixos/modules/config/fonts/fonts.nix deleted file mode 100644 index 87cf837e7c8..00000000000 --- a/nixos/modules/config/fonts/fonts.nix +++ /dev/null @@ -1,47 +0,0 @@ -{ 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; }; -} diff --git a/nixos/modules/config/fonts/packages.nix b/nixos/modules/config/fonts/packages.nix new file mode 100644 index 00000000000..cedac766fc6 --- /dev/null +++ b/nixos/modules/config/fonts/packages.nix @@ -0,0 +1,42 @@ +{ config, lib, pkgs, ... }: + +let + cfg = config.fonts; +in +{ + imports = [ + (lib.mkRemovedOptionModule [ "fonts" "enableCoreFonts" ] "Use fonts.packages = [ pkgs.corefonts ]; instead.") + (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."; + }; + + enableDefaultFonts = 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.enableDefaultFonts (with pkgs; [ + dejavu_fonts + freefont_ttf + gyre-fonts # TrueType substitutes for standard PostScript fonts + liberation_ttf + unifont + noto-fonts-emoji + ]); + }; +} diff --git a/nixos/modules/module-list.nix b/nixos/modules/module-list.nix index e6b6d2487d9..3fd466bf846 100644 --- a/nixos/modules/module-list.nix +++ b/nixos/modules/module-list.nix @@ -4,8 +4,8 @@ ./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