]> git.immae.eu Git - perso/Immae/Config/Nix.git/commitdiff
Fix nextcloud cron
authorIsmaël Bouya <ismael.bouya@normalesup.org>
Tue, 12 Nov 2019 06:14:01 +0000 (07:14 +0100)
committerIsmaël Bouya <ismael.bouya@normalesup.org>
Tue, 12 Nov 2019 06:14:01 +0000 (07:14 +0100)
modules/private/websites/tools/cloud/default.nix

index fffe04ca4076101fc484b0fa797cbe734936113d..99add805da548664819b7e1a1b2939f2635be42a 100644 (file)
@@ -177,10 +177,16 @@ in {
 
     services.cron = {
       enable = true;
-      systemCronJobs = [
+      systemCronJobs = let
+        script = pkgs.writeScriptBin "nextcloud-cron" ''
+          #! ${pkgs.stdenv.shell}
+          export LOCALE_ARCHIVE=/run/current-system/sw/lib/locale/locale-archive
+          export PATH=/run/wrappers/bin:$PATH
+          ${pkgs.php}/bin/php -f ${nextcloud}/cron.php
+          '';
+      in [
         ''
-          LOCALE_ARCHIVE=/run/current-system/sw/lib/locale/locale-archive
-          */15 * * * * wwwrun ${pkgs.php}/bin/php -f ${nextcloud}/cron.php
+          */15 * * * * wwwrun ${script}/bin/nextcloud-cron
         ''
       ];
     };