diff options
author | Maximilian Bosch <maximilian@mbosch.me> | 2024-06-04 19:18:03 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-06-04 19:18:03 +0000 |
commit | 7e2210236e687a086734d88bfab1a1d574ba8f2b (patch) | |
tree | 5b82903a91f36e7493b8ca56692d6464298a5fe2 /nixos | |
parent | 1993b60e0a901649502b2dbda7db68d5d93878dd (diff) | |
parent | dddd08d188e219f6cae33a509a2c3f5911a66a99 (diff) |
Merge pull request #316004 from Ma27/nc-memlimit
nixos/nextcloud: make memory_limit of nextcloud-cron configurable
Diffstat (limited to 'nixos')
-rw-r--r-- | nixos/modules/services/web-apps/nextcloud.nix | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/nixos/modules/services/web-apps/nextcloud.nix b/nixos/modules/services/web-apps/nextcloud.nix index 91d03dc160779..d7eb2c6cb734f 100644 --- a/nixos/modules/services/web-apps/nextcloud.nix +++ b/nixos/modules/services/web-apps/nextcloud.nix @@ -793,6 +793,16 @@ in { ''; }; }; + + cron.memoryLimit = mkOption { + type = types.nullOr types.str; + default = null; + example = "1G"; + description = '' + The `memory_limit` of PHP is equal to [](#opt-services.nextcloud.maxUploadSize). + The value can be customized for `nextcloud-cron.service` using this option. + ''; + }; }; config = mkIf cfg.enable (mkMerge [ @@ -1001,7 +1011,13 @@ in { Type = "exec"; User = "nextcloud"; ExecCondition = "${lib.getExe phpPackage} -f ${webroot}/occ status -e"; - ExecStart = "${lib.getExe phpPackage} -f ${webroot}/cron.php"; + ExecStart = lib.concatStringsSep " " ([ + (lib.getExe phpPackage) + ] ++ optional (cfg.cron.memoryLimit != null) "-dmemory_limit=${cfg.cron.memoryLimit}" + ++ [ + "-f" + "${webroot}/cron.php" + ]); KillMode = "process"; }; }; |