26 lines
736 B
Nix
26 lines
736 B
Nix
{pkgs, ...}:
|
|
{
|
|
sops.secrets.njalacloud = {};
|
|
sops.secrets.njalazines = {};
|
|
systemd.services."dyndns" = {
|
|
script = ''
|
|
KEYCLOUD=$(cat /run/secrets/njalacloud)
|
|
KEYZINES=$(cat /run/secrets/njalazines)
|
|
${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";
|
|
};
|
|
};
|
|
}
|