nix/host/home/Nextcloud.nix

31 lines
654 B
Nix
Raw Normal View History

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 {
systemd.services.nextcloud = {
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" ];
};
}