Author: eelco
Date: Tue Dec 28 15:56:22 2010
New Revision: 25307
URL: https://svn.nixos.org/websvn/nix/?rev=25307&sc=1

Log:
* Sync with the trunk.

Added:
   nixos/branches/stdenv-updates/modules/services/misc/svnserve.nix
      - copied unchanged from r25306, 
nixos/trunk/modules/services/misc/svnserve.nix
Modified:
   nixos/branches/stdenv-updates/   (props changed)
   nixos/branches/stdenv-updates/lib/testing.nix
   
nixos/branches/stdenv-updates/modules/installer/tools/nixos-deploy-network/nixos-deploy-network.sh
   nixos/branches/stdenv-updates/modules/installer/tools/nixos-hardware-scan.pl
   nixos/branches/stdenv-updates/modules/module-list.nix
   nixos/branches/stdenv-updates/modules/services/backup/hydra-mirror.nix
   nixos/branches/stdenv-updates/modules/services/misc/disnix.nix
   nixos/branches/stdenv-updates/modules/services/networking/dhclient.nix
   nixos/branches/stdenv-updates/tests/installer.nix

Modified: nixos/branches/stdenv-updates/lib/testing.nix
==============================================================================
--- nixos/branches/stdenv-updates/lib/testing.nix       Tue Dec 28 15:50:26 
2010        (r25306)
+++ nixos/branches/stdenv-updates/lib/testing.nix       Tue Dec 28 15:56:22 
2010        (r25307)
@@ -179,10 +179,9 @@
       '';
 
       vmRunCommand = writeText "vm-run" ''
-        ${coreutils}/bin/mkdir -p client
-        export > client/saved-env
+        ${coreutils}/bin/mkdir -p vm-state-client
+        export > vm-state-client/saved-env
         export PATH=${qemu_kvm}/bin:${coreutils}/bin
-        cp ${./test-driver/Machine.pm} Machine.pm
         export tests='${testscript}'
         ${testDriver}/bin/nixos-test-driver ${vms}/vms/*/bin/run-*-vm
       ''; # */

Modified: 
nixos/branches/stdenv-updates/modules/installer/tools/nixos-deploy-network/nixos-deploy-network.sh
==============================================================================
--- 
nixos/branches/stdenv-updates/modules/installer/tools/nixos-deploy-network/nixos-deploy-network.sh
  Tue Dec 28 15:50:26 2010        (r25306)
+++ 
nixos/branches/stdenv-updates/modules/installer/tools/nixos-deploy-network/nixos-deploy-network.sh
  Tue Dec 28 15:56:22 2010        (r25307)
@@ -63,5 +63,5 @@
 
 # Deploy the network
 
-vms=`nix-build $NIXOS/modules/installer/tools/nixos-deploy-network/deploy.nix 
--argstr networkExpr $networkExpr $showTraceArg $noOutLinkArg`
+vms=`nix-build $NIXOS/modules/installer/tools/nixos-deploy-network/deploy.nix 
--argstr networkExpr $networkExpr --argstr nixos $NIXOS $showTraceArg 
$noOutLinkArg`
 $vms/bin/deploy-systems

Modified: 
nixos/branches/stdenv-updates/modules/installer/tools/nixos-hardware-scan.pl
==============================================================================
--- 
nixos/branches/stdenv-updates/modules/installer/tools/nixos-hardware-scan.pl    
    Tue Dec 28 15:50:26 2010        (r25306)
+++ 
nixos/branches/stdenv-updates/modules/installer/tools/nixos-hardware-scan.pl    
    Tue Dec 28 15:56:22 2010        (r25307)
@@ -103,7 +103,7 @@
          $device eq "0x432c" || $device eq "0x432d" || $device eq "0x4353" ||
          $device eq "0x4357") )
      {
-        push @modulePackages, "kernelPackages.broadcom_sta";
+        push @modulePackages, "config.boot.kernelPackages.broadcom_sta";
         push @kernelModules, "wl";
      }
 
@@ -242,7 +242,7 @@
 print <<EOF ;
 # This is a generated file.  Do not modify!
 # Make changes to /etc/nixos/configuration.nix instead.
-{modulesPath, ...}:
+{ config, pkgs, modulesPath, ... }:
 
 {
   require = [
@@ -250,12 +250,9 @@
     "\${modulesPath}/installer/scan/not-detected.nix"
   ];
 
-  boot = rec {
-    initrd.kernelModules = [ $initrdKernelModules ];
-    kernelModules = [ $kernelModules ];
-    kernelPackages = pkgs.linuxPackages;
-    extraModulePackages = [ $modulePackages ];
-  };
+  boot.initrd.kernelModules = [ $initrdKernelModules ];
+  boot.kernelModules = [ $kernelModules ];
+  boot.extraModulePackages = [ $modulePackages ];
 
   nix.maxJobs = $cpus;
 

Modified: nixos/branches/stdenv-updates/modules/module-list.nix
==============================================================================
--- nixos/branches/stdenv-updates/modules/module-list.nix       Tue Dec 28 
15:50:26 2010        (r25306)
+++ nixos/branches/stdenv-updates/modules/module-list.nix       Tue Dec 28 
15:56:22 2010        (r25307)
@@ -73,6 +73,7 @@
   ./services/misc/nix-gc.nix
   ./services/misc/nixos-manual.nix
   ./services/misc/rogue.nix
+  ./services/misc/svnserve.nix
   ./services/misc/synergy.nix
   ./services/misc/virtualbox.nix
   ./services/monitoring/monit.nix

Modified: nixos/branches/stdenv-updates/modules/services/backup/hydra-mirror.nix
==============================================================================
--- nixos/branches/stdenv-updates/modules/services/backup/hydra-mirror.nix      
Tue Dec 28 15:50:26 2010        (r25306)
+++ nixos/branches/stdenv-updates/modules/services/backup/hydra-mirror.nix      
Tue Dec 28 15:56:22 2010        (r25307)
@@ -3,16 +3,30 @@
 with pkgs.lib;
 
 let 
-  cfg = config.services.hydraChannelMirror ;
+
+  cfg = config.services.hydraChannelMirror;
+
   mirrorChannel = pkgs.fetchsvn {
     url = 
https://svn.nixos.org/repos/nix/release/trunk/channels/mirror-channel.pl;
-    rev = 24132;
-    sha256 = "02xvswbbr2sj9k1wfraa0j9053vf6w88nhk15qwzs8nkm180n820";
+    rev = 25210;
+    sha256 = "0gspqid1rpsj1z1mr29nakh7di278nlv6v2knafvmm3g8ah3yxgz";
   };
-  cronjob = jobset : ''
-    ${cfg.period} root ENABLE_PATCHES=1 
PATH=${config.environment.nix}/libexec/nix:$PATH perl 
-I${config.environment.nix}/libexec/nix ${mirrorChannel} 
${cfg.hydraURL}/jobset/${jobset.project}/${jobset.jobset}/channel/latest 
${cfg.dataDir}/channels/${jobset.relURL} ${cfg.dataDir}/nars 
${cfg.mirrorURL}/nars ${cfg.dataDir}/patches ${cfg.mirrorURL}/patches ${if 
jobset.nixexprs == "" then "" else 
"${cfg.hydraURL}/job/${jobset.project}/${jobset.jobset}/${jobset.nixexprs}/latest/download-by-type/file/source-dist"}
 >> ${cfg.dataDir}/logs/${jobset.name}.log
-  '';
+
+  cronjob = jobset:
+    "${cfg.period} ${cfg.user}"
+    + optionalString cfg.enableBinaryPatches " ENABLE_PATCHES=1"
+    + " perl -I${config.environment.nix}/libexec/nix ${mirrorChannel}"
+    + " 
${cfg.hydraURL}/jobset/${jobset.project}/${jobset.jobset}/channel/latest"
+    + " ${cfg.dataDir}/${jobset.project}/channels/${jobset.name}"
+    + " ${cfg.dataDir}/nars"
+    + " ${cfg.mirrorURL}/nars"
+    + " ${cfg.dataDir}/patches"
+    + " ${cfg.mirrorURL}/patches"
+    + " ${if jobset.nixexprs == "" then "" else 
"${cfg.hydraURL}/job/${jobset.project}/${jobset.jobset}/${jobset.nixexprs}/latest/download-by-type/file/source-dist"}"
+    + " >> ${cfg.dataDir}/logs/${jobset.name}.log 2>&1\n";
+
 in
+
 {
   options = {
   
@@ -33,8 +47,15 @@
         '';
       };
 
+      user = mkOption {
+        default = "hydra-mirror";
+        description = ''
+          User running the Hydra mirror script.
+        '';
+      };
+
       jobsets = mkOption {
-        default = [ rec { name = "nixpkgs-unstable"; project = "nixpkgs"; 
jobset = "trunk"; nixexprs = "tarball"; relURL = "nixpkgs/channels/${name}"; } 
];
+        default = [ { name = "nixpkgs-unstable"; project = "nixpkgs"; jobset = 
"trunk"; nixexprs = "tarball"; } ];
         description = ''
           List of jobsets to mirror.
         '';
@@ -60,25 +81,41 @@
           Location of Hydra mirror data
         '';
       };
+
+      enableBinaryPatches = mkOption {
+        default = false;
+        description = ''
+          Whether to enable generating binary patches for the mirrored 
channels.
+        '';
+      };
     };
 
   };
 
   config = mkIf cfg.enable {
   
-    services.cron.systemCronJobs = map cronjob cfg.jobsets ;
+    users.extraUsers = singleton
+      { name = cfg.user; description = "Hydra mirror"; };
+
+    services.cron.systemCronJobs = map cronjob cfg.jobsets;
 
     system.activationScripts.hydraChannelMirror = stringAfter [ "stdio" 
"users" ]
       ''
         mkdir -m 0755 -p ${cfg.dataDir}
+        chown ${cfg.user} ${cfg.dataDir}
+
         mkdir -m 0755 -p ${cfg.dataDir}/nars
+        chown ${cfg.user} ${cfg.dataDir}/nars
+
         mkdir -m 0755 -p ${cfg.dataDir}/patches
-        mkdir -m 0755 -p ${cfg.dataDir}/channels
-        ln -fs ${cfg.dataDir}/nars ${cfg.dataDir}/channels/nars 
-        ln -fs ${cfg.dataDir}/patches ${cfg.dataDir}/channels/patches 
+        chown ${cfg.user} ${cfg.dataDir}/patches
+
         mkdir -m 0755 -p ${cfg.dataDir}/logs
+        chown ${cfg.user} ${cfg.dataDir}/logs
+
         ${concatMapStrings (j : ''
-        mkdir -m 0755 -p ${cfg.dataDir}/channels/${j.relURL}
+          mkdir -m 0755 -p ${cfg.dataDir}/{j.project}/channels/${j.name}
+          chown ${cfg.user} ${cfg.dataDir}/{j.project}/channels/${j.name}
         '') cfg.jobsets}
       '';
     

Modified: nixos/branches/stdenv-updates/modules/services/misc/disnix.nix
==============================================================================
--- nixos/branches/stdenv-updates/modules/services/misc/disnix.nix      Tue Dec 
28 15:50:26 2010        (r25306)
+++ nixos/branches/stdenv-updates/modules/services/misc/disnix.nix      Tue Dec 
28 15:56:22 2010        (r25307)
@@ -12,6 +12,8 @@
     enableAxis2WebService = config.services.tomcat.axis2.enable;
     enableEjabberdDump = config.services.ejabberd.enable;
     enableMySQLDatabase = config.services.mysql.enable;
+    enablePostgreSQLDatabase = config.services.postgresql.enable;
+    enableSubversionRepository = config.services.svnserve.enable;
     enableTomcatWebApplication = config.services.tomcat.enable;
   });
 in
@@ -93,6 +95,7 @@
         // optionalAttrs (config.services.httpd.enable) { documentRoot = 
config.services.httpd.documentRoot; }
         // optionalAttrs (config.services.mysql.enable) { mysqlPort = 
config.services.mysql.port; }
         // optionalAttrs (config.services.tomcat.enable) { tomcatPort = 8080; }
+       // optionalAttrs (config.services.svnserve.enable) { svnBaseDir = 
config.services.svnserve.svnBaseDir; }
        // optionalAttrs (cfg.publishInfrastructure.enableAuthentication) (
           optionalAttrs (config.services.mysql.enable) { mysqlUsername = 
"root"; mysqlPassword = builtins.readFile config.services.mysql.rootPassword; 
}) 
        )
@@ -129,7 +132,7 @@
                let infrastructureAttrValue = getAttr infrastructureAttrName 
(cfg.infrastructure);
                in
                if builtins.isInt infrastructureAttrValue then
-               ''${infrastructureAttrName}=${infrastructureAttrValue} \
+               ''${infrastructureAttrName}=${toString infrastructureAttrValue} 
\
                ''
                else
                 ''${infrastructureAttrName}=\"${infrastructureAttrValue}\" \

Copied: nixos/branches/stdenv-updates/modules/services/misc/svnserve.nix (from 
r25306, nixos/trunk/modules/services/misc/svnserve.nix)
==============================================================================
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ nixos/branches/stdenv-updates/modules/services/misc/svnserve.nix    Tue Dec 
28 15:56:22 2010        (r25307, copy of r25306, 
nixos/trunk/modules/services/misc/svnserve.nix)
@@ -0,0 +1,46 @@
+# SVN server
+{ config, pkgs, ... }:
+
+with pkgs.lib;
+
+let
+
+  cfg = config.services.svnserve;
+  
+in
+
+{
+
+  ###### interface
+  
+  options = {
+  
+    services.svnserve = {
+    
+      enable = mkOption {
+        default = false;
+        description = "Whether to enable svnserve to serve Subversion 
repositories through the SVN protocol.";
+      };
+      
+      svnBaseDir = mkOption {
+        default = "/repos";
+       description = "Base directory from which Subversion repositories are 
accessed.";
+      };
+    };
+    
+  };
+  
+
+  ###### implementation
+
+  config = mkIf cfg.enable {
+    jobs.svnserve = {
+      startOn = "started network-interfaces";
+      stopOn = "stopping network-interfaces";
+      
+      preStart = "mkdir -p ${cfg.svnBaseDir}";
+      
+      exec = "${pkgs.subversion}/bin/svnserve -r ${cfg.svnBaseDir} -d 
--foreground --pid-file=/var/run/svnserve.pid";
+    };
+  };
+}

Modified: nixos/branches/stdenv-updates/modules/services/networking/dhclient.nix
==============================================================================
--- nixos/branches/stdenv-updates/modules/services/networking/dhclient.nix      
Tue Dec 28 15:50:26 2010        (r25306)
+++ nixos/branches/stdenv-updates/modules/services/networking/dhclient.nix      
Tue Dec 28 15:56:22 2010        (r25307)
@@ -114,17 +114,8 @@
     powerManagement.resumeCommands =
       ''
         export PATH=${config.system.build.upstart}/sbin:$PATH
-      
-        restart() {
-            local job="$1"
-            if initctl status "$job" 2> /dev/null | grep -q 'running'; then
-                initctl stop "$job"
-                initctl start "$job"
-            fi
-        }
-
-        restart wpa_supplicant      
-        restart dhclient
+        initctl restart wpa_supplicant
+        initctl restart dhclient
       '';
 
   };  

Modified: nixos/branches/stdenv-updates/tests/installer.nix
==============================================================================
--- nixos/branches/stdenv-updates/tests/installer.nix   Tue Dec 28 15:50:26 
2010        (r25306)
+++ nixos/branches/stdenv-updates/tests/installer.nix   Tue Dec 28 15:56:22 
2010        (r25307)
@@ -304,7 +304,7 @@
       testScript =
         ''
           # damn, it's costly to evaluate nixos-rebuild (1G of ram)
-          my $machine = Machine->new({ cdrom => glob("${iso}/iso/*.iso"), 
qemuFlags => '${qemuNICFlags 1 1} -m 1024' });
+          my $machine = Machine->new({ cdrom => glob("${iso}/iso/*.iso"), 
qemuFlags => '${qemuNICFlags 1 1 1} -m 1024' });
           $machine->start;
 
           # Make sure that we don't try to download anything.
_______________________________________________
nix-commits mailing list
[email protected]
http://mail.cs.uu.nl/mailman/listinfo/nix-commits

Reply via email to