9 cfg = config.services.ddns-updater;
12 options.services.ddns-updater = {
13 enable = lib.mkEnableOption "Container to update DNS records periodically with WebUI for many DNS providers";
15 package = lib.mkPackageOption pkgs "ddns-updater" { };
17 environment = lib.mkOption {
18 type = lib.types.attrsOf lib.types.str;
19 description = "Environment variables to be set for the ddns-updater service. DATADIR is ignored to enable using systemd DynamicUser. For full list see https://github.com/qdm12/ddns-updater";
24 config = lib.mkIf cfg.enable {
26 systemd.services.ddns-updater = {
27 wantedBy = [ "multi-user.target" ];
28 wants = [ "network-online.target" ];
29 after = [ "network-online.target" ];
30 environment = cfg.environment // {
31 DATADIR = "%S/ddns-updater";
34 Description = "DDNS-updater service";
38 ExecStart = lib.getExe cfg.package;
41 StateDirectory = "ddns-updater";
42 Restart = "on-failure";