1 # Module for the IPv6 Router Advertisement Daemon.
3 { config, lib, pkgs, ... }:
9 cfg = config.services.radvd;
11 confFile = pkgs.writeText "radvd.conf" cfg.config;
19 options.services.radvd = {
25 Whether to enable the Router Advertisement Daemon
26 ({command}`radvd`), which provides link-local
27 advertisements of IPv6 router addresses and prefixes using
28 the Neighbor Discovery Protocol (NDP). This enables
29 stateless address autoconfiguration in IPv6 clients on the
34 package = mkPackageOption pkgs "radvd" { };
36 debugLevel = mkOption {
41 The debugging level is an integer in the range from 1 to 5,
42 from quiet to very verbose. A debugging level of 0 completely
53 prefix 2001:db8:1234:5678::/64 { };
57 The contents of the radvd configuration file.
66 config = mkIf cfg.enable {
72 description = "Router Advertisement Daemon User";
74 users.groups.radvd = {};
76 systemd.services.radvd =
77 { description = "IPv6 Router Advertisement Daemon";
78 wantedBy = [ "multi-user.target" ];
79 after = [ "network.target" ];
81 { ExecStart = "@${cfg.package}/bin/radvd radvd -n -u radvd -d ${toString cfg.debugLevel} -C ${confFile}";