From 59c6b68501d7857e7356c02abd535a520cb13595 Mon Sep 17 00:00:00 2001 From: soraefir Date: Sat, 9 May 2026 19:40:22 +0200 Subject: [PATCH] Add cron --- modules/server/containers/default.nix | 8 +++++++- modules/server/containers/defs/nextcloud.nix | 2 ++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/modules/server/containers/default.nix b/modules/server/containers/default.nix index 3e87a2c..7fd2d17 100644 --- a/modules/server/containers/default.nix +++ b/modules/server/containers/default.nix @@ -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; + }; + }; } \ No newline at end of file diff --git a/modules/server/containers/defs/nextcloud.nix b/modules/server/containers/defs/nextcloud.nix index 0c2c064..afe18ce 100644 --- a/modules/server/containers/defs/nextcloud.nix +++ b/modules/server/containers/defs/nextcloud.nix @@ -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" ]; }