* Refactoring.

svn path=/nixos/trunk/; revision=10671
This commit is contained in:
Eelco Dolstra 2008-02-14 07:42:52 +00:00
parent 6e06b11097
commit 18123c08ca
5 changed files with 27 additions and 38 deletions

View File

@ -162,7 +162,7 @@ import ../helpers/make-etc.nix {
# Configuration file for fontconfig used to locate # Configuration file for fontconfig used to locate
# (X11) client-rendered fonts. # (X11) client-rendered fonts.
++ optional config.fonts.enableFontConfig { ++ optional config.fonts.enableFontConfig {
source = pkgs.runCommand "fonts.conf" source = pkgs.runCommand "fonts.conf"
{ {
fontDirectories = import ../system/fonts.nix {inherit pkgs config;}; fontDirectories = import ../system/fonts.nix {inherit pkgs config;};

View File

@ -1277,7 +1277,7 @@
description = "List of Java webapplications that should be mapped to the servlet container (Tomcat/JBoss)"; description = "List of Java webapplications that should be mapped to the servlet container (Tomcat/JBoss)";
}; };
}; };
subservices = { subservices = {
subversion = { subversion = {
@ -1354,22 +1354,11 @@
}; };
extraSubservices = { extraSubservices = mkOption {
default = [];
enable = mkOption { description = "
default = false; Extra subservices to enable in the webserver.
description = " ";
Whether to enable the extra subservices in the webserver.
";
};
services = mkOption {
default = [];
description = "
Extra subservices to enable in the webserver.
";
};
}; };
}; };

View File

@ -18,11 +18,10 @@ let
}; };
subservices = [ subservices = map (svc: svc {inherit config pkgs serverInfo;}) cfg.extraSubservices;
(import ./subversion.nix {inherit config pkgs serverInfo;})
];
# !!! should be in lib
writeTextInDir = name: text: writeTextInDir = name: text:
pkgs.runCommand name {inherit text;} "ensureDir $out; echo -n \"$text\" > $out/$name"; pkgs.runCommand name {inherit text;} "ensureDir $out; echo -n \"$text\" > $out/$name";
@ -134,17 +133,12 @@ let
''; '';
robotsTxt = writeTextInDir "robots.txt" '' robotsTxt = pkgs.writeText "robots.txt" ''
${pkgs.lib.concatStrings (map (svc: svc.robotsEntries) subservices)} ${pkgs.lib.concatStrings (map (svc: svc.robotsEntries) subservices)}
''; '';
robotsConf = '' robotsConf = ''
Alias /robots.txt ${robotsTxt}/robots.txt Alias /robots.txt ${robotsTxt}
<Directory ${robotsTxt}>
Order allow,deny
Allow from all
</Directory>
''; '';
@ -215,12 +209,19 @@ let
${if cfg.enableSSL then sslConf else ""} ${if cfg.enableSSL then sslConf else ""}
# Fascist default - deny access to everything. # Fascist default - deny access to everything.
# !!!
<Directory /> <Directory />
Options FollowSymLinks Options FollowSymLinks
AllowOverride None AllowOverride None
# Order deny,allow Order deny,allow
# Deny from all Deny from all
</Directory>
# But do allow access to files in the store so that we don't have
# to generate <Directory> clauses for every generated file that we
# want to serve.
<Directory /nix/store>
Order allow,deny
Allow from all
</Directory> </Directory>
${documentRootConf} ${documentRootConf}

View File

@ -64,7 +64,9 @@ let
]; ];
# Do a syntax check on the generated file. # Do a syntax check on the generated file.
postInstall = "$perl -c -T $out/cgi-bin/repoman.pl; $perl -c $out/bin/svn-server-create-user.pl"; postInstall = ''
$perl -c -T $out/cgi-bin/repoman.pl; $perl -c $out/bin/svn-server-create-user.pl
'';
}; };
@ -246,9 +248,8 @@ let
writeTextInDir = name: text: writeTextInDir = name: text:
pkgs.runCommand name {inherit text;} ''ensureDir $out; echo -n "$text" > $out/$name''; pkgs.runCommand name {inherit text;} ''ensureDir $out; echo -n "$text" > $out/$name'';
substituteInSome = args: pkgs.stdenv.mkDerivation ({ substituteInSome = args: pkgs.stdenvUsingSetupNew2.mkDerivation ({
buildCommand = '' buildCommand = ''
buildCommand= # ugh, hack to prevent sed errors
ensureDir $out ensureDir $out
cp -prd $src/* $out cp -prd $src/* $out
chmod -R u+w $out chmod -R u+w $out
@ -258,9 +259,8 @@ let
''; '';
} // args); # */ } // args); # */
substituteInAll = args: pkgs.stdenv.mkDerivation ({ substituteInAll = args: pkgs.stdenvUsingSetupNew2.mkDerivation ({
buildCommand = '' buildCommand = ''
buildCommand= # ugh, hack to prevent sed errors
ensureDir $out ensureDir $out
cp -prd $src/* $out cp -prd $src/* $out
chmod -R u+w $out chmod -R u+w $out

View File

@ -78,7 +78,6 @@ Section "Device"
Identifier "Device[0]" Identifier "Device[0]"
Driver "@videoDriver@" Driver "@videoDriver@"
Option "Clone" "@isClone@" Option "Clone" "@isClone@"
#Option "MonitorLayout" "CRT,LFP"
@device@ @device@
@internalAGPGART@ @internalAGPGART@
@extraDeviceConfig@ @extraDeviceConfig@
@ -90,7 +89,7 @@ Section "ServerLayout"
InputDevice "Keyboard[0]" "CoreKeyboard" InputDevice "Keyboard[0]" "CoreKeyboard"
InputDevice "@corePointer@" "CorePointer" InputDevice "@corePointer@" "CorePointer"
Screen "Screen[0]" Screen "Screen[0]"
@serverLayoutOptions@ @serverLayoutOptions@
EndSection EndSection