Author: eelco
Date: 2010-07-06 08:21:05 +0000 (Tue, 06 Jul 2010)
New Revision: 22487

You can view the changes in this commit at:
   https://svn.nixos.org/viewvc/nix?rev=22487&view=rev

Added:
   nixos/branches/boot-order/modules/services/networking/quassel.nix
   nixos/branches/boot-order/modules/services/networking/sabnzbd.nix
Modified:
   nixos/branches/boot-order/
   
nixos/branches/boot-order/modules/installer/tools/nixos-bootstrap-archive/default.nix
   nixos/branches/boot-order/modules/misc/ids.nix
   nixos/branches/boot-order/modules/module-list.nix
   nixos/branches/boot-order/modules/services/misc/nix-daemon.nix

Log:
* Sync with the trunk.


Changes:


Property changes on: nixos/branches/boot-order
___________________________________________________________________
Modified: svn:mergeinfo
   - /nixos/branches/fix-style:13689-13861,14192-14408,14450-14826
/nixos/branches/upstart-0.6:18180-18619
/nixos/trunk:13326-15006,15032,15058,15061-15062,15074,15086,15145,15192,15204,15208,15211,15274,15312,15326,15340,15344-15346,15348,15368-15370,15391,15396-15397,15407-15408,15413,15424,15427-15428,15430,15464,15468-15469,15480,15505,15508-15509,15519,15548,15577,15580,15609,15620,15633,15656,15660-15661,15669,15695-15696,15704-15705,15779,15811,15822-15824,15831,15899,16050,16196,16200,22147-22346
   + /nixos/branches/fix-style:13689-13861,14192-14408,14450-14826
/nixos/branches/upstart-0.6:18180-18619
/nixos/trunk:13326-15006,15032,15058,15061-15062,15074,15086,15145,15192,15204,15208,15211,15274,15312,15326,15340,15344-15346,15348,15368-15370,15391,15396-15397,15407-15408,15413,15424,15427-15428,15430,15464,15468-15469,15480,15505,15508-15509,15519,15548,15577,15580,15609,15620,15633,15656,15660-15661,15669,15695-15696,15704-15705,15779,15811,15822-15824,15831,15899,16050,16196,16200,22147-22486

Modified: 
nixos/branches/boot-order/modules/installer/tools/nixos-bootstrap-archive/default.nix
===================================================================
--- 
nixos/branches/boot-order/modules/installer/tools/nixos-bootstrap-archive/default.nix
       2010-07-06 08:18:14 UTC (rev 22486)
+++ 
nixos/branches/boot-order/modules/installer/tools/nixos-bootstrap-archive/default.nix
       2010-07-06 08:21:05 UTC (rev 22487)
@@ -17,4 +17,6 @@
       $(s ${nixosBootstrap}/bin/nixos-bootstrap )
       
   cat tmp.tar | bzip2 > $out/nixos-install-archive.tar.bz2
+  ensureDir $out/nix-support
+  echo "file tarball" $out/nixos-install-archive.tar.bz2 > 
$out/nix-support/hydra-build-products
 ''

Modified: nixos/branches/boot-order/modules/misc/ids.nix
===================================================================
--- nixos/branches/boot-order/modules/misc/ids.nix      2010-07-06 08:18:14 UTC 
(rev 22486)
+++ nixos/branches/boot-order/modules/misc/ids.nix      2010-07-06 08:21:05 UTC 
(rev 22487)
@@ -53,6 +53,7 @@
     davfs2 = 31;
     privoxy = 32;    
     osgi = 34;
+    sabnzbd = 33;
     tor = 35;    
     # When adding a uid, make sure it doesn't match an existing gid.
 

Modified: nixos/branches/boot-order/modules/module-list.nix
===================================================================
--- nixos/branches/boot-order/modules/module-list.nix   2010-07-06 08:18:14 UTC 
(rev 22486)
+++ nixos/branches/boot-order/modules/module-list.nix   2010-07-06 08:21:05 UTC 
(rev 22487)
@@ -92,10 +92,12 @@
   ./services/networking/openvpn.nix
   ./services/networking/portmap.nix
   ./services/networking/privoxy.nix
+  ./services/networking/quassel.nix
   ./services/networking/ssh/lshd.nix
   ./services/networking/ssh/sshd.nix
   ./services/networking/tftpd.nix
   ./services/networking/vsftpd.nix
+  ./services/networking/sabnzbd.nix
   ./services/networking/wicd.nix
   ./services/networking/wpa_supplicant.nix
   ./services/networking/xinetd.nix

Modified: nixos/branches/boot-order/modules/services/misc/nix-daemon.nix
===================================================================
--- nixos/branches/boot-order/modules/services/misc/nix-daemon.nix      
2010-07-06 08:18:14 UTC (rev 22486)
+++ nixos/branches/boot-order/modules/services/misc/nix-daemon.nix      
2010-07-06 08:21:05 UTC (rev 22487)
@@ -162,10 +162,6 @@
         internal = true;
         default = "";
         merge = mergeStringOption;
-        example = ''
-          export NIX_TARGET_LOAD=$(( 3 * $(${pkgs.coreutils}/bin/nproc) / 2 ))
-          export NIX_MAX_PARALLELIZATION=$NIX_TARGET_LOAD
-        '';
         description = "
           Environment variables used by Nix.
         ";

Copied: nixos/branches/boot-order/modules/services/networking/quassel.nix (from 
rev 22486, nixos/trunk/modules/services/networking/quassel.nix)
===================================================================
--- nixos/branches/boot-order/modules/services/networking/quassel.nix           
                (rev 0)
+++ nixos/branches/boot-order/modules/services/networking/quassel.nix   
2010-07-06 08:21:05 UTC (rev 22487)
@@ -0,0 +1,97 @@
+{ config, pkgs, ... }:
+
+with pkgs.lib;
+
+let
+  quassel = pkgs.quassel.override { daemon = true; monolithic = false; client 
= false; };
+  cfg = config.services.quassel;
+in
+
+{
+
+  ###### interface
+
+  options = {
+  
+    services.quassel = {
+
+      enable = mkOption {
+        default = false;
+        description = ''
+          Whether to run the Quassel IRC client daemon.
+        '';
+      };
+
+      interface = mkOption {
+        default = "127.0.0.1";
+        description = ''
+          The interface the Quassel daemon will be listening to.  If 
`127.0.0.1',
+          only clients on the local host can connect to it; if `0.0.0.0', 
clients
+          can access it from any network interface.
+        '';
+      };
+
+      portNumber = mkOption {
+        default = 4242;
+        description = ''
+          The port number the Quassel daemon will be listening to.
+        '';
+      };
+
+      logFile = mkOption {
+        default = "/var/log/quassel.log";
+        description = "Location of the logfile of the Quassel daemon.";
+      };
+
+      dataDir = mkOption {
+        default = ''/home/${cfg.user}/.config/quassel-irc.org'';
+        description = ''
+          The directory holding configuration files, the SQlite database and 
the SSL Cert.
+        '';
+      };
+
+      user = mkOption {
+        default = "quassel";
+        description = ''
+          The user the Quassel daemon should run as.
+        '';
+      };
+
+    };
+
+  };
+  
+
+  ###### implementation
+
+  config = mkIf cfg.enable {
+
+    users.extraUsers = singleton
+      { name = cfg.user;
+        description = "Quassel IRC client daemon";
+      };
+    
+
+    jobs.quassel =
+      { description = "Quassel IRC client daemon";
+
+        startOn = "ip-up";
+
+        preStart = ''
+            mkdir -p ${cfg.dataDir}
+            chown ${cfg.user} ${cfg.dataDir}
+            touch ${cfg.logFile} && chown ${cfg.user} ${cfg.logFile}
+        '';
+
+        exec = ''
+            ${pkgs.su}/bin/su -s ${pkgs.stdenv.shell} ${cfg.user} \
+                -c '${quassel}/bin/quasselcore --listen=${cfg.interface}\
+                    --port=${toString cfg.portNumber} 
--configdir=${cfg.dataDir} --logfile=${cfg.logFile}'
+        '';
+      };
+
+    environment.systemPackages = [ quassel ];
+
+  };
+  
+}

Copied: nixos/branches/boot-order/modules/services/networking/sabnzbd.nix (from 
rev 22486, nixos/trunk/modules/services/networking/sabnzbd.nix)
===================================================================
--- nixos/branches/boot-order/modules/services/networking/sabnzbd.nix           
                (rev 0)
+++ nixos/branches/boot-order/modules/services/networking/sabnzbd.nix   
2010-07-06 08:21:05 UTC (rev 22487)
@@ -0,0 +1,52 @@
+{ config, pkgs, ... }:
+
+with pkgs.lib;
+
+let 
+
+  cfg = config.services.sabnzbd;
+  inherit (pkgs) sabnzbd;
+
+in
+
+{
+
+  ###### interface
+
+  options = {
+    services.sabnzbd = {
+      enable = mkOption {
+        default = false;
+        description = "Whether to enable the sabnzbd FTP server.";
+      };
+      configFile = mkOption {
+        default = "/var/sabnzbd/sabnzbd.ini";
+        description = "Path to config file. (You need to create this file 
yourself!)";
+      };
+    };
+  };
+  
+
+  ###### implementation
+
+  config = mkIf cfg.enable {
+
+    users.extraUsers =
+      [ { name = "sabnzbd";
+          uid = config.ids.uids.sabnzbd;
+          description = "sabnzbd user";
+          home = "/homeless-shelter";
+        }
+      ];
+
+    jobs.sabnzbd =
+      { description = "sabnzbd server";
+
+        startOn = "network-interfaces/started";
+        stopOn = "network-interfaces/stop";
+
+        exec = "${sabnzbd}/bin/sabnzbd -d -f ${cfg.configFile}";
+      };
+
+  };
+}

_______________________________________________
nix-commits mailing list
[email protected]
http://mail.cs.uu.nl/mailman/listinfo/nix-commits

Reply via email to