Author: eelco
Date: Thu Mar 24 16:23:28 2011
New Revision: 26496
URL: https://svn.nixos.org/websvn/nix/?rev=26496&sc=1

Log:
* Add the rdnss daemon.
* Add the ndisc6 package to the system path if IPv6 is enabled.

Added:
   nixos/trunk/modules/services/networking/rdnssd.nix
Modified:
   nixos/trunk/modules/module-list.nix
   nixos/trunk/modules/tasks/network-interfaces.nix

Modified: nixos/trunk/modules/module-list.nix
==============================================================================
--- nixos/trunk/modules/module-list.nix Thu Mar 24 16:03:43 2011        (r26495)
+++ nixos/trunk/modules/module-list.nix Thu Mar 24 16:23:28 2011        (r26496)
@@ -107,6 +107,7 @@
   ./services/networking/privoxy.nix
   ./services/networking/quassel.nix
   ./services/networking/radvd.nix
+  ./services/networking/rdnssd.nix
   ./services/networking/sabnzbd.nix
   ./services/networking/ssh/lshd.nix
   ./services/networking/ssh/sshd.nix

Added: nixos/trunk/modules/services/networking/rdnssd.nix
==============================================================================
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ nixos/trunk/modules/services/networking/rdnssd.nix  Thu Mar 24 16:23:28 
2011        (r26496)
@@ -0,0 +1,47 @@
+# Module for rdnssd, a daemon that configures DNS servers in
+# /etc/resolv/conf from IPv6 RDNSS advertisements.
+
+{ config, pkgs, ... }:
+
+with pkgs.lib;
+
+{
+
+  ###### interface
+
+  options = {
+  
+    services.rdnssd.enable = mkOption {
+      default = config.networking.enableIPv6;
+      description =
+        ''
+          Whether to enable the RDNSS daemon
+          (<command>rdnssd</command>), which configures DNS servers in
+          <filename>/etc/resolv.conf</filename> from RDNSS
+          advertisements sent by IPv6 routers.
+        '';
+    };
+
+  };
+
+
+  ###### implementation
+
+  config = mkIf config.services.rdnssd.enable {
+
+    jobs.rdnssd =
+      { description = "RDNSS daemon";
+      
+        # Start before the network interfaces are brought up so that
+        # the daemon receives RDNSS advertisements from the kernel.
+        startOn = "starting network-interfaces";
+
+        # !!! Should write to /var/run/rdnssd/resolv.conf and run the daemon 
under another uid.
+        exec = "${pkgs.ndisc6}/sbin/rdnssd --resolv-file /etc/resolv.conf -u 
root";
+
+        daemonType = "fork";
+      };
+
+  };
+  
+}

Modified: nixos/trunk/modules/tasks/network-interfaces.nix
==============================================================================
--- nixos/trunk/modules/tasks/network-interfaces.nix    Thu Mar 24 16:03:43 
2011        (r26495)
+++ nixos/trunk/modules/tasks/network-interfaces.nix    Thu Mar 24 16:23:28 
2011        (r26496)
@@ -179,7 +179,9 @@
         pkgs.nettools
         pkgs.wirelesstools
         pkgs.rfkill
-      ] ++ optional (cfg.bridges != {}) [ pkgs.bridge_utils ];
+      ] 
+      ++ optional (cfg.bridges != {}) pkgs.bridge_utils
+      ++ optional cfg.enableIPv6 pkgs.ndisc6;
 
     security.setuidPrograms = [ "ping" "ping6" ];
     
_______________________________________________
nix-commits mailing list
[email protected]
http://mail.cs.uu.nl/mailman/listinfo/nix-commits

Reply via email to