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
''
];
};