From 327cb83cf2fba4c368e4fc37463b1923691e0344 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Mon, 22 Jan 2007 16:42:29 +0000 Subject: [PATCH] * Make it possible to turn off the generation of fonts.conf. This is important for the installation CD, where we don't want a dependency on all those fonts. Of course, it's quite nice that turning off the generation of a file automatically removes the dependencies on the files referenced by that file. svn path=/nixos/trunk/; revision=7750 --- configuration/rescue-cd.nix | 6 +++- system/etc.nix | 55 +++++++++++++++++++------------------ system/options.nix | 13 +++++++++ 3 files changed, 46 insertions(+), 28 deletions(-) diff --git a/configuration/rescue-cd.nix b/configuration/rescue-cd.nix index 08dd2479149..1da1b25fe25 100644 --- a/configuration/rescue-cd.nix +++ b/configuration/rescue-cd.nix @@ -49,10 +49,14 @@ rec { }; + fonts = { + enableFontConfig = false; + }; + installer = { nixpkgsURL = http://nix.cs.uu.nl/dist/nix/ + nixpkgsRel; }; - + }; diff --git a/system/etc.nix b/system/etc.nix index 4dec5ff61ea..c1422f1ea9c 100644 --- a/system/etc.nix +++ b/system/etc.nix @@ -77,35 +77,36 @@ import ../helpers/make-etc.nix { target = "profile"; } - { # Configuration file for fontconfig used to locate - # (X11) client-rendered fonts. - source = pkgs.runCommand "fonts.conf" - { - fontDirectories = [ - # - the user's .fonts directory - "~/.fonts" - # - the user's current profile - "~/.nix-profile/lib/X11/fonts" - # - the default profile - "/nix/var/nix/profiles/default/lib/X11/fonts" - # - a few statically built locations - pkgs.xorg.fontbhttf - pkgs.xorg.fontbh100dpi - pkgs.xorg.fontbhlucidatypewriter100dpi - pkgs.freefont_ttf - ]; - buildInputs = [pkgs.libxslt]; - inherit (pkgs) fontconfig; - } - "xsltproc --stringparam fontDirectories \"$fontDirectories\" \\ - ${./etc/fonts/make-fonts-conf.xsl} $fontconfig/etc/fonts/fonts.conf \\ - > $out - "; - target = "fonts/fonts.conf"; - } - ] + # Configuration file for fontconfig used to locate + # (X11) client-rendered fonts. + ++ (optional ["fonts" "enableFontConfig"] { + source = pkgs.runCommand "fonts.conf" + { + fontDirectories = [ + # - the user's .fonts directory + "~/.fonts" + # - the user's current profile + "~/.nix-profile/lib/X11/fonts" + # - the default profile + "/nix/var/nix/profiles/default/lib/X11/fonts" + # - a few statically built locations + pkgs.xorg.fontbhttf + pkgs.xorg.fontbh100dpi + pkgs.xorg.fontbhlucidatypewriter100dpi + pkgs.freefont_ttf + ]; + buildInputs = [pkgs.libxslt]; + inherit (pkgs) fontconfig; + } + "xsltproc --stringparam fontDirectories \"$fontDirectories\" \\ + ${./etc/fonts/make-fonts-conf.xsl} $fontconfig/etc/fonts/fonts.conf \\ + > $out + "; + target = "fonts/fonts.conf"; + }) + # LDAP configuration. ++ (optional ["users" "ldap" "enable"] { source = import etc/ldap.conf.nix { diff --git a/system/options.nix b/system/options.nix index 311c9a7995b..36c9084b8df 100644 --- a/system/options.nix +++ b/system/options.nix @@ -579,5 +579,18 @@ "; } + + { + name = ["fonts" "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. + "; + } + ]