Created
May 25, 2023 16:03
-
-
Save zmej420/1c55c0baa6597321db3105a4a227b486 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ 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