* Pure X server. All fonts are now in the Nix store.

svn path=/nixos/trunk/; revision=8041
This commit is contained in:
Eelco Dolstra 2007-02-25 15:53:57 +00:00
parent 0828400b36
commit 3ad2c91939
5 changed files with 46 additions and 22 deletions

View File

@ -88,23 +88,7 @@ import ../helpers/make-etc.nix {
++ (optional ["fonts" "enableFontConfig"] { ++ (optional ["fonts" "enableFontConfig"] {
source = pkgs.runCommand "fonts.conf" source = pkgs.runCommand "fonts.conf"
{ {
fontDirectories = [ fontDirectories = import ./fonts.nix {inherit pkgs;};
# - the user's .fonts directory
"~/.fonts"
# - the user's current profile
"~/.nix-profile/lib/X11/fonts"
"~/.nix-profile/share/fonts"
# - the default profile
"/nix/var/nix/profiles/default/lib/X11/fonts"
"/nix/var/nix/profiles/default/share/fonts"
# - a few statically built locations
pkgs.xorg.fontbhttf
pkgs.xorg.fontbh100dpi
pkgs.xorg.fontbhlucidatypewriter100dpi
pkgs.ttf_bitstream_vera
pkgs.corefonts
pkgs.freefont_ttf
];
buildInputs = [pkgs.libxslt]; buildInputs = [pkgs.libxslt];
inherit (pkgs) fontconfig; inherit (pkgs) fontconfig;
} }

22
system/fonts.nix Normal file
View File

@ -0,0 +1,22 @@
{pkgs}:
[
# - the user's .fonts directory
"~/.fonts"
# - the user's current profile
"~/.nix-profile/lib/X11/fonts"
"~/.nix-profile/share/fonts"
# - the default profile
"/nix/var/nix/profiles/default/lib/X11/fonts"
"/nix/var/nix/profiles/default/share/fonts"
# - a few statically built locations
pkgs.xorg.fontbhttf
pkgs.xorg.fontbhlucidatypewriter100dpi
pkgs.ttf_bitstream_vera
pkgs.corefonts
pkgs.freefont_ttf
pkgs.xorg.fontbh100dpi
pkgs.xorg.fontmiscmisc
pkgs.xorg.fontalias
pkgs.xorg.fontcursormisc
]

View File

@ -118,8 +118,9 @@ import ../upstart-jobs/gather.nix {
# X server. # X server.
++ optional ["services" "xserver" "enable"] ++ optional ["services" "xserver" "enable"]
(import ../upstart-jobs/xserver.nix { (import ../upstart-jobs/xserver.nix {
inherit (pkgs) substituteAll; inherit (pkgs) stdenv lib;
inherit (pkgs.xorg) xorgserver xf86inputkeyboard xf86inputmouse xf86videovesa; inherit (pkgs.xorg) xorgserver xf86inputkeyboard xf86inputmouse xf86videovesa;
fontDirectories = import ./fonts.nix {inherit pkgs;};
}) })
# Apache httpd. # Apache httpd.

View File

@ -1,4 +1,5 @@
Section "Files" Section "Files"
@fontPaths@
EndSection EndSection

View File

@ -1,4 +1,6 @@
{ substituteAll { stdenv
, lib
, xorgserver , xorgserver
@ -14,13 +16,29 @@
, # X display number. , # X display number.
display ? 0 display ? 0
, # List of font directories.
fontDirectories
}: }:
let let
config = substituteAll { config = stdenv.mkDerivation {
name = "xserver.conf"; name = "xserver.conf";
src = ./xserver.conf; src = ./xserver.conf;
inherit fontDirectories;
buildCommand = "
buildCommand= # urgh, don't substitute this
export fontPaths=
for i in $fontDirectories; do
if test \"\${i:0:\${#NIX_STORE}}\" == \"$NIX_STORE\"; then
for j in $(find $i -name fonts.dir); do
fontPaths=\"\${fontPaths}FontPath \\\"$(dirname $j)\\\"\\n\"
done
fi
done
substituteAll $src $out
";
}; };
in in
@ -39,11 +57,9 @@ end script
exec ${xorgserver}/bin/X \\ exec ${xorgserver}/bin/X \\
-ac -nolisten tcp -terminate \\ -ac -nolisten tcp -terminate \\
-logfile /var/log/X.${toString display}.log \\ -logfile /var/log/X.${toString display}.log \\
-fp /var/fonts \\
-modulepath ${xorgserver}/lib/xorg/modules,${xf86inputkeyboard}/lib/xorg/modules/input,${xf86inputmouse}/lib/xorg/modules/input,${xf86videovesa}/lib/xorg/modules/drivers \\ -modulepath ${xorgserver}/lib/xorg/modules,${xf86inputkeyboard}/lib/xorg/modules/input,${xf86inputmouse}/lib/xorg/modules/input,${xf86videovesa}/lib/xorg/modules/drivers \\
-config ${config} \\ -config ${config} \\
:${toString display} vt${toString tty} :${toString display} vt${toString tty}
"; ";
} }