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.
launchpad/nixpkgs/master
talyz 3 years ago
parent ba4d2bd03c
commit 41c82cd570
No known key found for this signature in database
GPG Key ID: 2DED2151F4671A2B
  1. 9
      nixos/modules/services/misc/geoipupdate.nix

@ -152,6 +152,15 @@ in
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 ];

Loading…
Cancel
Save