Add cron
This commit is contained in:
@@ -12,11 +12,12 @@ let
|
||||
) defs.containers;
|
||||
paths = defs.paths or [];
|
||||
setup = defs.setup or null;
|
||||
cron = defs.cron or [];
|
||||
}
|
||||
) enabledConfigs;
|
||||
mergedContainers = lib.attrsets.mergeAttrsList (lib.map(e: e.containers) containerSetsList);
|
||||
allPathConfigs = lib.flatten (lib.map (e: e.paths) containerSetsList);
|
||||
allScriptConfigs = lib.flatten (lib.map (e: e.init or "") containerSetsList);
|
||||
allCronsConfigs = lib.flatten (lib.map (e: e.cron or []) containerSetsList);
|
||||
in
|
||||
{
|
||||
config = lib.mkIf ( enabledConfigs != {} ) {
|
||||
@@ -64,5 +65,10 @@ in
|
||||
}] else []
|
||||
) containerSetsList);
|
||||
|
||||
services.cron = {
|
||||
enable = true;
|
||||
systemCronJobs = allCronsConfigs;
|
||||
};
|
||||
|
||||
};
|
||||
}
|
||||
@@ -85,4 +85,6 @@ in {
|
||||
echo "Completed Setup"
|
||||
'';
|
||||
};
|
||||
|
||||
cron = [ "*/5 * * * * root ${pkgs.podman}/bin/podman --events-backend=none exec -u www-data nextcloud-server php -f /var/www/html/cron.php" ];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user