diff options
author | Eelco Dolstra <eelco.dolstra@logicblox.com> | 2013-06-27 13:12:45 +0200 |
---|---|---|
committer | Eelco Dolstra <eelco.dolstra@logicblox.com> | 2013-06-27 13:12:45 +0200 |
commit | 0cbf0605d2faddba69ff8f897f574680992fd388 (patch) | |
tree | 8aecc1193562df369914e4e9510e6250ac121731 /modules/config/fonts/fontconfig.nix | |
parent | 85d5366c1078774db9ac898422408694dd3756a3 (diff) | |
download | nixpkgs-0cbf0605d2faddba69ff8f897f574680992fd388.tar nixpkgs-0cbf0605d2faddba69ff8f897f574680992fd388.tar.gz nixpkgs-0cbf0605d2faddba69ff8f897f574680992fd388.tar.bz2 nixpkgs-0cbf0605d2faddba69ff8f897f574680992fd388.tar.lz nixpkgs-0cbf0605d2faddba69ff8f897f574680992fd388.tar.xz nixpkgs-0cbf0605d2faddba69ff8f897f574680992fd388.tar.zst nixpkgs-0cbf0605d2faddba69ff8f897f574680992fd388.zip |
Refactoring: Split fonts.nix into smaller modules
Diffstat (limited to 'modules/config/fonts/fontconfig.nix')
-rw-r--r-- | modules/config/fonts/fontconfig.nix | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/modules/config/fonts/fontconfig.nix b/modules/config/fonts/fontconfig.nix new file mode 100644 index 00000000000..ce3ffdffdc9 --- /dev/null +++ b/modules/config/fonts/fontconfig.nix @@ -0,0 +1,45 @@ +{ config, pkgs, ... }: + +with pkgs.lib; + +{ + + options = { + + fonts = { + + enableFontConfig = mkOption { # !!! should be enableFontconfig + 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; }; + + environment.shellInit = + '' + # FIXME: This variable is no longer needed, but we'll keep it + # around for a while for applications linked against old + # fontconfig builds. + export FONTCONFIG_FILE=/etc/fonts/fonts.conf + ''; + + environment.systemPackages = [ pkgs.fontconfig ]; + + }; + +} |