From f5416889730b60d20bc779bd4dfdf6ca361ae4db Mon Sep 17 00:00:00 2001 From: beatzaplenty Date: Mon, 13 Jul 2026 01:25:16 +1000 Subject: [PATCH] modularized nextcloud cron job --- hosts/docker/configuration.nix | 55 +++++++++++----------------------- modules/nextcloud-cron-job.nix | 22 ++++++++++++++ 2 files changed, 39 insertions(+), 38 deletions(-) create mode 100644 modules/nextcloud-cron-job.nix diff --git a/hosts/docker/configuration.nix b/hosts/docker/configuration.nix index d6d8b88..47973ab 100644 --- a/hosts/docker/configuration.nix +++ b/hosts/docker/configuration.nix @@ -27,6 +27,7 @@ in ../../modules/tailscale/enable-service.nix ../../modules/rotate-traefik-logs.nix ../../modules/raspi/mount-data.nix + ../../modules/nextcloud-cron-job.nix ]; @@ -46,46 +47,24 @@ boot.supportedFilesystems = [ "nfs" ]; services.rpcbind.enable = true; -# fileSystems."/mnt/raspi" = { -# device = "raspberrypi.tail13f623.ts.net:/home/raspi/raspi"; -# fsType = "nfs4"; -# options = [ -# "nofail" -# "_netdev" -# "noatime" - -# # Don't mount until first access -# "x-systemd.automount" - -# # Unmount after 10 min idle -# "x-systemd.idle-timeout=600" - -# # Give the Pi/Tailscale a little time to appear -# "x-systemd.device-timeout=10s" - -# # Explicitly use NFSv4.2 if supported -# "nfsvers=4.2" -# ]; +# # Create nextcloud cron scheduled task +# systemd.services.nextcloud = { +# description = "Nextcloud scheduled task"; +# script = ''${pkgs.bash}/bin/bash ~/docker/services-up.sh --profile nextcloud exec -u 33 nextcloud-webapp php ./cron.php''; +# serviceConfig = { +# Type = "oneshot"; +# User = "nixos"; +# }; +# path = with pkgs; [ docker docker-compose ]; # }; -# Create nextcloud cron scheduled task -systemd.services.nextcloud = { - description = "Nextcloud scheduled task"; - script = ''${pkgs.bash}/bin/bash ~/docker/services-up.sh --profile nextcloud exec -u 33 nextcloud-webapp php ./cron.php''; - serviceConfig = { - Type = "oneshot"; - User = "nixos"; - }; - path = with pkgs; [ docker docker-compose ]; -}; - -systemd.timers.nextcloud = { - wantedBy = [ "timers.target" ]; - timerConfig = { - OnCalendar = "*:0/5"; - Persistent = true; - }; -}; +# systemd.timers.nextcloud = { +# wantedBy = [ "timers.target" ]; +# timerConfig = { +# OnCalendar = "*:0/5"; +# Persistent = true; +# }; +# }; # Create nextcloud cron scheduled task # systemd.services.docker-prune = { diff --git a/modules/nextcloud-cron-job.nix b/modules/nextcloud-cron-job.nix new file mode 100644 index 0000000..796e9c4 --- /dev/null +++ b/modules/nextcloud-cron-job.nix @@ -0,0 +1,22 @@ +{ pkgs, ... }: + +{ +# Create nextcloud cron scheduled task +systemd.services.nextcloud = { + description = "Nextcloud scheduled task"; + script = ''${pkgs.bash}/bin/bash ~/docker/services-up.sh --profile nextcloud exec -u 33 nextcloud-webapp php ./cron.php''; + serviceConfig = { + Type = "oneshot"; + User = "nixos"; + }; + path = with pkgs; [ docker docker-compose ]; +}; + +systemd.timers.nextcloud = { + wantedBy = [ "timers.target" ]; + timerConfig = { + OnCalendar = "*:0/5"; + Persistent = true; + }; +}; +} \ No newline at end of file