0
0
Fork 0
mirror of https://github.com/NixOS/nixpkgs.git synced 2025-07-13 21:50:33 +03:00

cloudflare-dyndns: configurable systemd frequency

This commit is contained in:
Hraban Luyat 2024-07-03 22:41:08 -04:00
parent 61684d356e
commit 406351b470

View file

@ -28,6 +28,16 @@ in
''; '';
}; };
frequency = mkOption {
type = types.nullOr types.str;
default = "*:0/5";
description = ''
Run cloudflare-dyndns with the given frequency (see
{manpage}`systemd.time(7)` for the format).
If null, do not run automatically.
'';
};
proxied = mkOption { proxied = mkOption {
type = types.bool; type = types.bool;
default = false; default = false;
@ -67,7 +77,6 @@ in
description = "CloudFlare Dynamic DNS Client"; description = "CloudFlare Dynamic DNS Client";
after = [ "network.target" ]; after = [ "network.target" ];
wantedBy = [ "multi-user.target" ]; wantedBy = [ "multi-user.target" ];
startAt = "*:0/5";
environment = { environment = {
CLOUDFLARE_DOMAINS = toString cfg.domains; CLOUDFLARE_DOMAINS = toString cfg.domains;
@ -88,6 +97,8 @@ in
in in
"${pkgs.cloudflare-dyndns}/bin/cloudflare-dyndns ${toString args}"; "${pkgs.cloudflare-dyndns}/bin/cloudflare-dyndns ${toString args}";
}; };
} // optionalAttrs (cfg.frequency != null) {
startAt = cfg.frequency;
}; };
}; };
} }