diff --git a/.gitignore b/.gitignore index e43b0f9..ddced76 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ .DS_Store +.cloudflare_dns_updater_api_token diff --git a/home.nix b/home.nix index bafcef4..18a0e42 100644 --- a/home.nix +++ b/home.nix @@ -183,4 +183,22 @@ (import ./dm-mono.nix { inherit lib fetchzip; }) ]; + launchd.agents.dyndns-updater = { + enable = true; + config = { + Program = "${pkgs.cloudflare-dyndns}/bin/cloudflare-dyndns"; + ProgramArguments = [ + "${pkgs.cloudflare-dyndns}/bin/cloudflare-dyndns" + "--api-token" + (builtins.readFile ./.cloudflare_dns_updater_api_token) + "--debug" + "home.abhinavsarkar.net" + ]; + StandardErrorPath = "/tmp/cloudflare-dyndns.log"; + StandardOutPath = "/tmp/cloudflare-dyndns.log"; + StartInterval = 600; + ProcessType = "Background"; + }; + }; + }