mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-17 07:13:23 +01:00
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.
This commit is contained in:
parent
ba4d2bd03c
commit
41c82cd570
1 changed files with 9 additions and 0 deletions
|
@ -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…
Reference in a new issue