* 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
+1 -12
View File
@@ -1354,16 +1354,7 @@
}; };
extraSubservices = { extraSubservices = mkOption {
enable = mkOption {
default = false;
description = "
Whether to enable the extra subservices in the webserver.
";
};
services = mkOption {
default = []; default = [];
description = " description = "
Extra subservices to enable in the webserver. Extra subservices to enable in the webserver.
@@ -1372,8 +1363,6 @@
}; };
};
vsftpd = { vsftpd = {
enable = mkOption { enable = mkOption {
default = false; default = false;
+14 -13
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}
+5 -5
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
-1
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@