nixos/geoipupdate: Run the service right away one time
We don't want to have to wait for the timer to expire for the updater
to make its first run. This adds a timer unit which triggers the
geoipupdate.service unit immediately, but only runs if the configured
DatabaseDirectory doesn't exist yet.
commit41c82cd57033ce8122899b8cf96dc824c7ce7e8d
authortalyz <kim.lindberger@gmail.com>
dateMon 7 Jun 2021, 13:08 (5 years ago)
parentba4d2bd
nixos/modules/services/misc/geoipupdate.nix+9
@@ -152,6 +152,15 @@ in
152152 RuntimeDirectoryMode = 0700;
153153 };
154154 };
155+
156+ systemd.timers.geoipupdate-initial-run = {
157+ wantedBy = [ "timers.target" ];
158+ unitConfig.ConditionPathExists = "!${cfg.settings.DatabaseDirectory}";
159+ timerConfig = {
160+ Unit = "geoipupdate.service";
161+ OnActiveSec = 0;
162+ };
163+ };
155164 };
156165
157166 meta.maintainers = [ lib.maintainers.talyz ];