2024-04-08 18:26:01 +03:00
|
|
|
{ pkgs, style, util, ... } @args: let
|
|
|
|
bash = import ../../module/common/bash/Init.nix args;
|
|
|
|
script = ''
|
|
|
|
docker exec -u 33 cloud php -f /var/www/html/cron.php || notify 'Nextcloud : Failed to run cron.'
|
|
|
|
'';
|
|
|
|
in {
|
2024-03-04 00:34:39 +03:00
|
|
|
systemd.services.nextcloud = {
|
|
|
|
enable = true;
|
|
|
|
description = "Nextcloud worker.";
|
|
|
|
serviceConfig = {
|
2024-04-08 18:26:01 +03:00
|
|
|
Type = "oneshot";
|
2024-03-04 00:34:39 +03:00
|
|
|
};
|
|
|
|
path = with pkgs; [
|
|
|
|
bashInteractive
|
|
|
|
docker
|
|
|
|
];
|
2024-04-08 18:26:01 +03:00
|
|
|
script = ''
|
|
|
|
${pkgs.bashInteractive}/bin/bash ${script}
|
|
|
|
'';
|
2024-03-04 00:34:39 +03:00
|
|
|
};
|
|
|
|
|
|
|
|
systemd.timers.nextcloud = {
|
|
|
|
timerConfig = {
|
|
|
|
OnCalendar = "hourly";
|
|
|
|
Persistent = false;
|
|
|
|
Unit = "nextcloud.service";
|
|
|
|
};
|
|
|
|
wantedBy = [ "timers.target" ];
|
|
|
|
};
|
|
|
|
}
|