Files
infrastructure/machines/fanny/dyndns.nix

25 lines
737 B
Nix

{pkgs, ...}:
{
sops.secrets.njalacloud = {};
sops.secrets.njalazines = {};
systemd.services."dyndns" = {
script = ''
KEYCLOUD=$(cat /run/secrets/njallacloud)
KEYZINES=$(cat /run/secrets/njallazines)
${pkgs.curl}/bin/curl --fail --silent --show-error "https://njal.la/update/?h=cloud.malobeo.org&k="$KEYCLOUD"&auto"
${pkgs.curl}/bin/curl --fail --silent --show-error "https://njal.la/update/?h=zines.malobeo.org&k="$KEYZINES"&auto"
'';
serviceConfig = {
Type = "oneshot";
User = "root";
};
};
systemd.timers."dyndns" = {
wantedBy = ["timers.target"];
timerConfig = {
OnBootSec = "100s";
OnUnitActiveSec = "10m";
Unit = "dyndns.service";
};
};
}