2013-06-27 12:12:45 +01:00
|
|
|
{ config, pkgs, ... }:
|
|
|
|
|
|
|
|
with pkgs.lib;
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
options = {
|
|
|
|
|
|
|
|
fonts = {
|
|
|
|
|
|
|
|
enableFontConfig = mkOption { # !!! should be enableFontconfig
|
2013-10-30 14:33:20 +00:00
|
|
|
type = types.bool;
|
2013-06-27 12:12:45 +01:00
|
|
|
default = true;
|
|
|
|
description = ''
|
|
|
|
If enabled, a Fontconfig configuration file will be built
|
|
|
|
pointing to a set of default fonts. If you don't care about
|
|
|
|
running X11 applications or any other program that uses
|
|
|
|
Fontconfig, you can turn this option off and prevent a
|
|
|
|
dependency on all those fonts.
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
config = mkIf config.fonts.enableFontConfig {
|
|
|
|
|
|
|
|
# Bring in the default (upstream) fontconfig configuration.
|
|
|
|
environment.etc."fonts/fonts.conf".source =
|
|
|
|
pkgs.makeFontsConf { fontDirectories = config.fonts.fonts; };
|
|
|
|
|
2013-06-27 12:28:22 +01:00
|
|
|
environment.etc."fonts/conf.d/00-nixos.conf".text =
|
|
|
|
''
|
|
|
|
<?xml version='1.0'?>
|
|
|
|
<!DOCTYPE fontconfig SYSTEM 'fonts.dtd'>
|
|
|
|
<fontconfig>
|
|
|
|
|
|
|
|
<!-- Set the default hinting style to "slight". -->
|
|
|
|
<match target="font">
|
|
|
|
<edit mode="assign" name="hintstyle">
|
|
|
|
<const>hintslight</const>
|
|
|
|
</edit>
|
|
|
|
</match>
|
|
|
|
|
|
|
|
</fontconfig>
|
|
|
|
'';
|
|
|
|
|
2013-09-18 04:18:34 +01:00
|
|
|
# FIXME: This variable is no longer needed, but we'll keep it
|
|
|
|
# around for a while for applications linked against old
|
|
|
|
# fontconfig builds.
|
2013-09-23 22:03:21 +01:00
|
|
|
environment.variables.FONTCONFIG_FILE = "/etc/fonts/fonts.conf";
|
2013-06-27 12:12:45 +01:00
|
|
|
|
|
|
|
environment.systemPackages = [ pkgs.fontconfig ];
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|