mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-07-13 21:50:33 +03:00
Merge pull request #316004 from Ma27/nc-memlimit
nixos/nextcloud: make memory_limit of nextcloud-cron configurable
This commit is contained in:
commit
7e2210236e
1 changed files with 17 additions and 1 deletions
|
@ -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 [
|
config = mkIf cfg.enable (mkMerge [
|
||||||
|
@ -1001,7 +1011,13 @@ in {
|
||||||
Type = "exec";
|
Type = "exec";
|
||||||
User = "nextcloud";
|
User = "nextcloud";
|
||||||
ExecCondition = "${lib.getExe phpPackage} -f ${webroot}/occ status -e";
|
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";
|
KillMode = "process";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue