1 { config, lib, pkgs, ... }:
6 cfg = config.services.r53-ddns;
13 enable = mkEnableOption (lib.mdDoc "r53-ddyns");
18 description = lib.mdDoc "How often to update the entry";
23 description = lib.mdDoc "The ID of your zone in Route53";
28 description = lib.mdDoc "The name of your domain in Route53";
33 description = lib.mdDoc ''
34 Manually specify the hostname. Otherwise the tool will try to use the name
35 returned by the OS (Call to gethostname)
39 environmentFile = mkOption {
41 description = lib.mdDoc ''
42 File containing the AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY
43 in the format of an EnvironmentFile as described by systemd.exec(5)
50 config = mkIf cfg.enable {
52 systemd.timers.r53-ddns = {
53 description = "r53-ddns timer";
54 wantedBy = [ "timers.target" ];
56 OnBootSec = cfg.interval;
57 OnUnitActiveSec = cfg.interval;
61 systemd.services.r53-ddns = {
62 description = "r53-ddns service";
64 ExecStart = "${pkg}/bin/r53-ddns -zone-id ${cfg.zoneID} -domain ${cfg.domain}"
65 + lib.optionalString (cfg.hostname != null) " -hostname ${cfg.hostname}";
66 EnvironmentFile = "${cfg.environmentFile}";