41 lines
793 B
Nix
41 lines
793 B
Nix
{ config, lib, pkgs, ... }: {
|
|
|
|
options.sysconfig.services.dynamicDNS.enable = lib.options.mkOption {
|
|
|
|
type = lib.types.bool;
|
|
default = false;
|
|
};
|
|
|
|
config = lib.mkIf config.sysconfig.services.dynamicDNS {
|
|
|
|
systemd.timers.dynamicDNS = {
|
|
|
|
wantedBy = [ "timers.target" ];
|
|
|
|
timerConfig = {
|
|
|
|
OnBootSec = "5m";
|
|
|
|
OnUnitActiveSec = "1h";
|
|
|
|
Unit = "dynamicDNS.service";
|
|
};
|
|
};
|
|
|
|
systemd.services.dynamicDNS = {
|
|
|
|
name = "dynamicDNS.service";
|
|
|
|
serviceConfig = {
|
|
|
|
Type = "oneshot";
|
|
|
|
LoadCredential = [ "cloudflare-api-key" ];
|
|
|
|
};
|
|
|
|
script = '''';
|
|
};
|
|
};
|
|
}
|