mirror of
https://github.com/buckley310/nixos-config.git
synced 2024-11-09 18:47:02 +00:00
phpipam: merge cron tasks
This commit is contained in:
parent
d1426db0fe
commit
d522460c08
1 changed files with 10 additions and 15 deletions
|
@ -25,12 +25,6 @@ let
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
cronScripts = {
|
|
||||||
phpipam_ping = "exec ${pkgs.php74}/bin/php ${phpipamHtdocs}/functions/scripts/pingCheck.php";
|
|
||||||
phpipam_remove_offline = "exec ${pkgs.php74}/bin/php ${phpipamHtdocs}/functions/scripts/remove_offline_addresses.php";
|
|
||||||
phpipam_discovery = "exec ${pkgs.php74}/bin/php ${phpipamHtdocs}/functions/scripts/discoveryCheck.php";
|
|
||||||
};
|
|
||||||
|
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
options.sconfig.phpipam = {
|
options.sconfig.phpipam = {
|
||||||
|
@ -62,17 +56,18 @@ in
|
||||||
then { text = ""; }
|
then { text = ""; }
|
||||||
else { source = cfg.configFile; };
|
else { source = cfg.configFile; };
|
||||||
|
|
||||||
systemd.services = builtins.mapAttrs
|
systemd = {
|
||||||
(_: script: {
|
services.phpipam-tasks = {
|
||||||
inherit script;
|
script = ''
|
||||||
|
${pkgs.php74}/bin/php ${phpipamHtdocs}/functions/scripts/pingCheck.php
|
||||||
|
${pkgs.php74}/bin/php ${phpipamHtdocs}/functions/scripts/discoveryCheck.php
|
||||||
|
${pkgs.php74}/bin/php ${phpipamHtdocs}/functions/scripts/remove_offline_addresses.php
|
||||||
|
'';
|
||||||
serviceConfig.User = "nginx";
|
serviceConfig.User = "nginx";
|
||||||
startAt = "*:0/15";
|
startAt = "*:0/15";
|
||||||
})
|
};
|
||||||
cronScripts;
|
timers.phpipam-tasks.timerConfig.RandomizedDelaySec = 600;
|
||||||
|
};
|
||||||
systemd.timers = builtins.mapAttrs
|
|
||||||
(_: _: { timerConfig.RandomizedDelaySec = 600; })
|
|
||||||
cronScripts;
|
|
||||||
|
|
||||||
services = {
|
services = {
|
||||||
phpfpm.phpPackage = pkgs.php74;
|
phpfpm.phpPackage = pkgs.php74;
|
||||||
|
|
Loading…
Reference in a new issue