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 = {
26 Whether to enable the Router Advertisement Daemon
27 ({command}`radvd`), which provides link-local
28 advertisements of IPv6 router addresses and prefixes using
29 the Neighbor Discovery Protocol (NDP). This enables
30 stateless address autoconfiguration in IPv6 clients on the
38 defaultText = literalExpression "pkgs.radvd";
39 description = lib.mdDoc ''
40 The RADVD package to use for the RADVD service.
50 prefix 2001:db8:1234:5678::/64 { };
55 The contents of the radvd configuration file.
64 config = mkIf cfg.enable {
70 description = "Router Advertisement Daemon User";
72 users.groups.radvd = {};
74 systemd.services.radvd =
75 { description = "IPv6 Router Advertisement Daemon";
76 wantedBy = [ "multi-user.target" ];
77 after = [ "network.target" ];
79 { ExecStart = "@${cfg.package}/bin/radvd radvd -n -u radvd -C ${confFile}";