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;