feat(tilo): enable cron job for Nextcloud docker container

This commit is contained in:
Lucien Cartier-Tilet 2025-06-04 19:08:12 +02:00
parent 683796549f
commit 912213803f
Signed by: phundrak
SSH Key Fingerprint: SHA256:CE0HPsbW3L2YiJETx1zYZ2muMptaAqTN2g3498KrMkc
3 changed files with 26 additions and 0 deletions

View File

@ -14,6 +14,7 @@
../../modules/ssh.nix
../../modules/endlessh.nix
../../programs/nano.nix
./services
];
system = {

View File

@ -0,0 +1,3 @@
{
imports = [./nextcloud-cron.nix];
}

View File

@ -0,0 +1,22 @@
{pkgs, ...}: {
systemd = {
timers."nextcloud-cron" = {
wantedBy = [""];
timerConfig = {
OnBootSec = "5m";
OnUnitActiveSec = "5m";
Unit = "nextcloud-cron.service";
};
};
services."nextcloud-cron" = {
script = ''
set -eu
${pkgs.docker}/bin/docker exec -u www-data -it nextcloud-nextcloud-1 php /var/www/html/cron.php
'';
serviceConfig = {
Type = "oneshot";
User = "root";
};
};
};
}