diff options
author | Thomas Tuegel <ttuegel@gmail.com> | 2015-08-04 12:08:35 -0500 |
---|---|---|
committer | Thomas Tuegel <ttuegel@gmail.com> | 2015-08-04 12:15:29 -0500 |
commit | ba59ff216096feb83d3285d7d864da3394240ef1 (patch) | |
tree | 8d840bbb614a58d1ddf6a1664edbcc53cc6a1f3e /nixos | |
parent | 47dad51c2bd8990d4742ba9f3cc1a39d3cbcf702 (diff) |
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`.
Diffstat (limited to 'nixos')
-rw-r--r-- | nixos/modules/config/fonts/fontconfig.nix | 31 |
1 files changed, 20 insertions, 11 deletions
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: "<bool>" + (if x then "true" else "false") + "</bool>"; - nixosConf = '' + renderConf = '' <?xml version='1.0'?> <!DOCTYPE fontconfig SYSTEM 'fonts.dtd'> <fontconfig> @@ -169,6 +169,21 @@ with lib; </edit> </match> + ${optionalString (fontconfig.dpi != 0) '' + <match target="pattern"> + <edit name="dpi" mode="assign"> + <double>${toString fontconfig.dpi}</double> + </edit> + </match> + ''} + + </fontconfig> + ''; + genericAliasConf = '' + <?xml version='1.0'?> + <!DOCTYPE fontconfig SYSTEM 'fonts.dtd'> + <fontconfig> + <!-- Default fonts --> ${optionalString (fontconfig.defaultFonts.sansSerif != []) '' <alias> @@ -201,14 +216,6 @@ with lib; </alias> ''} - ${optionalString (fontconfig.dpi != 0) '' - <match target="pattern"> - <edit name="dpi" mode="assign"> - <double>${toString fontconfig.dpi}</double> - </edit> - </match> - ''} - </fontconfig> ''; 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; </fontconfig> ''; - 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; |