From ba59ff216096feb83d3285d7d864da3394240ef1 Mon Sep 17 00:00:00 2001 From: Thomas Tuegel Date: Tue, 4 Aug 2015 12:08:35 -0500 Subject: nixos/fontconfig: separate rendering and alias configuration Fixes #9110. Fontconfig recommends different precedence for rendering settings and generic alias settings. To comply with the recommendations, `98-nixos.conf` has been separated into `10-nixos-rendering.conf` and `60-nixos-generic-alias.conf`. --- nixos/modules/config/fonts/fontconfig.nix | 31 ++++++++++++++++++++----------- 1 file changed, 20 insertions(+), 11 deletions(-) (limited to 'nixos/modules/config/fonts') diff --git a/nixos/modules/config/fonts/fontconfig.nix b/nixos/modules/config/fonts/fontconfig.nix index 6f17bd396a0b..922a9cf961df 100644 --- a/nixos/modules/config/fonts/fontconfig.nix +++ b/nixos/modules/config/fonts/fontconfig.nix @@ -142,7 +142,7 @@ with lib; config = let fontconfig = config.fonts.fontconfig; fcBool = x: "" + (if x then "true" else "false") + ""; - nixosConf = '' + renderConf = '' @@ -169,6 +169,21 @@ with lib; + ${optionalString (fontconfig.dpi != 0) '' + + + ${toString fontconfig.dpi} + + + ''} + + + ''; + genericAliasConf = '' + + + + ${optionalString (fontconfig.defaultFonts.sansSerif != []) '' @@ -201,14 +216,6 @@ with lib; ''} - ${optionalString (fontconfig.dpi != 0) '' - - - ${toString fontconfig.dpi} - - - ''} - ''; in mkIf fontconfig.enable { @@ -219,7 +226,8 @@ with lib; environment.etc."fonts/fonts.conf".source = pkgs.makeFontsConf { fontconfig = pkgs.fontconfig_210; fontDirectories = config.fonts.fonts; }; - environment.etc."fonts/conf.d/98-nixos.conf".text = nixosConf; + environment.etc."fonts/conf.d/10-nixos-rendering.conf".text = renderConf; + environment.etc."fonts/conf.d/60-nixos-generic-alias.conf".text = genericAliasConf; # Versioned fontconfig > 2.10. Take shared fonts.conf from fontconfig. # Otherwise specify only font directories. @@ -236,7 +244,8 @@ with lib; ''; - environment.etc."fonts/${pkgs.fontconfig.configVersion}/conf.d/98-nixos.conf".text = nixosConf; + environment.etc."fonts/${pkgs.fontconfig.configVersion}/conf.d/10-nixos-rendering.conf".text = renderConf; + environment.etc."fonts/${pkgs.fontconfig.configVersion}/conf.d/60-nixos-generic-alias.conf".text = genericAliasConf; environment.etc."fonts/${pkgs.fontconfig.configVersion}/conf.d/99-user.conf" = { enable = fontconfig.includeUserConf; -- cgit 1.4.1