Skip to content

Instantly share code, notes, and snippets.

@zmej420
Created May 25, 2023 16:03
Show Gist options
  • Save zmej420/1c55c0baa6597321db3105a4a227b486 to your computer and use it in GitHub Desktop.
Save zmej420/1c55c0baa6597321db3105a4a227b486 to your computer and use it in GitHub Desktop.
{ pkgs, ... }:
let user = 1000; in
{
systemd = {
timers = {
gandi-update-dns = {
description = "Update dns every 15 minutes";
timerConfig = {
Persistent="True";
OnCalendar=["*-*-* *:0/15:00"]; # Every 15 minutes
};
wantedBy = [ "default.target" ];
};
};
services = {
gandi-update-dns = {
description = "Send current IP address to gandi for my domains with gandi-update-dns.rb ruby script";
after = ["network.target"];
serviceConfig = {
Restart = "on-failure";
ExecStart = "${pkgs.ruby}/bin/ruby ${./gandi-update-dns.rb}";
User = user;
};
wantedBy = ["default.target"];
};
};
};
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment