nix-files/machines/uninsane/services/ddns-he.nix
colin f8cf676df4 uninsane: add a hurricane electric ddns service
also adds some basic secrets management. i can make this more robust in time.
2022-05-24 17:24:11 -07:00

18 lines
630 B
Nix

{ pkgs, secrets, ... }:
{
systemd.services.ddns-he = {
description = "update dynamic DNS entries for HurricaneElectric";
# HE DDNS API is documented: https://dns.he.net/docs.html
script = let
pass = secrets.ddns-he.password;
crl = "${pkgs.curl}/bin/curl -4";
in ''
${crl} "https://he.uninsane.org:${pass}@dyn.dns.he.net/nic/update?hostname=he.uninsane.org"
${crl} "https://native.uninsane.org:${pass}@dyn.dns.he.net/nic/update?hostname=native.uninsane.org"
${crl} "https://uninsane.org:${pass}@dyn.dns.he.net/nic/update?hostname=uninsane.org"
'';
startAt = "10min";
};
}