2011-03-24 16:23:28 +00:00
|
|
|
# Module for rdnssd, a daemon that configures DNS servers in
|
|
|
|
# /etc/resolv/conf from IPv6 RDNSS advertisements.
|
|
|
|
|
2014-04-14 15:26:48 +01:00
|
|
|
{ config, lib, pkgs, ... }:
|
2011-03-24 16:23:28 +00:00
|
|
|
|
2014-04-14 15:26:48 +01:00
|
|
|
with lib;
|
2011-03-24 16:23:28 +00:00
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
###### interface
|
|
|
|
|
|
|
|
options = {
|
2011-09-14 19:20:50 +01:00
|
|
|
|
2011-03-24 16:23:28 +00:00
|
|
|
services.rdnssd.enable = mkOption {
|
2011-03-25 09:29:22 +00:00
|
|
|
default = false;
|
|
|
|
#default = config.networking.enableIPv6;
|
2011-03-24 16:23:28 +00:00
|
|
|
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";
|
2011-09-14 19:20:50 +01:00
|
|
|
|
2011-03-24 16:23:28 +00:00
|
|
|
# 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";
|
|
|
|
};
|
|
|
|
|
|
|
|
};
|
2011-09-14 19:20:50 +01:00
|
|
|
|
2011-03-24 16:23:28 +00:00
|
|
|
}
|