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.

talyz 41c82cd5 ba4d2bd0

Changed files
+9
nixos
modules
services
+9
nixos/modules/services/misc/geoipupdate.nix
···
RuntimeDirectoryMode = 0700;
};
};
+
+
systemd.timers.geoipupdate-initial-run = {
+
wantedBy = [ "timers.target" ];
+
unitConfig.ConditionPathExists = "!${cfg.settings.DatabaseDirectory}";
+
timerConfig = {
+
Unit = "geoipupdate.service";
+
OnActiveSec = 0;
+
};
+
};
};
meta.maintainers = [ lib.maintainers.talyz ];