nixos/hosts/gerg-desktop/services/ddns.nix
2024-08-16 23:44:27 -04:00

31 lines
578 B
Nix

{
config,
pkgs,
_dir,
}:
{
sops.secrets.cloudflare = { };
systemd.services.ddns = {
reloadIfChanged = false;
restartIfChanged = false;
stopIfChanged = false;
wantedBy = [ "multi-user.target" ];
wants = [ "network-online.target" ];
after = [ "network-online.target" ];
startAt = "hourly";
serviceConfig = {
EnvironmentFile = config.sops.secrets.cloudflare.path;
DynamicUser = true;
};
path = [
pkgs.netcat
pkgs.jq
pkgs.curl
];
script = builtins.readFile "${_dir}/ddns_script.sh";
};
}