nix-files/hosts/by-name/servo/services/ddns-he.nix

31 lines
998 B
Nix
Raw Normal View History

2022-12-18 23:09:13 +00:00
{ config, lib, pkgs, ... }:
2022-12-18 23:09:13 +00:00
# we use manual DDNS now
lib.mkIf false
{
systemd.services.ddns-he = {
description = "update dynamic DNS entries for HurricaneElectric";
2022-06-08 21:32:16 +00:00
serviceConfig = {
EnvironmentFile = config.sops.secrets."ddns_he.env".path;
2022-06-08 21:32:16 +00:00
# TODO: ProtectSystem = "strict";
# TODO: ProtectHome = "full";
# TODO: PrivateTmp = true;
};
# HE DDNS API is documented: https://dns.he.net/docs.html
script = let
crl = "${pkgs.curl}/bin/curl -4";
in ''
2022-06-08 21:32:16 +00:00
${crl} "https://he.uninsane.org:$HE_PASSPHRASE@dyn.dns.he.net/nic/update?hostname=he.uninsane.org"
${crl} "https://native.uninsane.org:$HE_PASSPHRASE@dyn.dns.he.net/nic/update?hostname=native.uninsane.org"
${crl} "https://uninsane.org:$HE_PASSPHRASE@dyn.dns.he.net/nic/update?hostname=uninsane.org"
'';
2022-05-25 02:02:51 +00:00
};
2022-06-20 22:36:48 +00:00
systemd.timers.ddns-he = {
wantedBy = [ "multi-user.target" ];
timerConfig = {
OnStartupSec = "2min";
OnUnitActiveSec = "10min";
};
};
}