Added dir option to link all fonts into share.

svn path=/nixos/trunk/; revision=9407
This commit is contained in:
Michael Raskin 2007-10-05 07:25:13 +00:00
parent 94b7b9377c
commit 44d09afffb
3 changed files with 36 additions and 0 deletions

20
system/fontdir.nix Normal file
View File

@ -0,0 +1,20 @@
args:
with args;
stdenv.mkDerivation
{
name="X11-fonts";
phases="installPhase";
fontDirs = import ./fonts.nix {inherit pkgs config;};
installPhase = "
mkdir -p \$out/share/X11-fonts/;
for i in \$fontDirs; do
if ! echo \$i | egrep '~|/nix/var/nix/profiles' &>/dev/null; then
j=\${i#/nix/store/}
j=\${j%%/*}
if ! test -e \$out/share/X11-fonts/\${g}; then
ln -s \$i \$out/share/X11-fonts/\${j};
fi;
fi;
done;
";
}

View File

@ -1128,6 +1128,15 @@ root ALL=(ALL) SETENV: ALL
various URW fonts and the Base-14 Postscript fonts) to the
list of system fonts, making them available to X11
applications.
";
}
{
name=["fonts" "enableFontDir"];
default = false;
description = "
Whether to create a directory with links to all fonts in share -
so user can configure vncserver script one time (I mean per-user
vncserver, so global service is not a good solution).
";
}

View File

@ -162,6 +162,11 @@ rec {
extraEtc = pkgs.lib.concatLists (map (job: job.extraEtc) upstartJobs.jobs);
};
# Font aggregation
fontDir = import ./fontdir.nix {
inherit (pkgs) stdenv;
inherit pkgs config;
};
# The wrapper setuid programs (since we can't have setuid programs
# in the Nix store).
@ -322,6 +327,8 @@ rec {
inherit activateConfiguration;
inherit grubMenuBuilder;
inherit etc;
fontDir = (if config.get ["fonts" "enableFontDir"] then
fontDir else null);
inherit systemPath;
kernel = kernel + "/vmlinuz";
initrd = initialRamdisk + "/initrd";