nix/host/home/Nextcloud.nix

31 lines
673 B
Nix
Raw Normal View History

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