feat: add memory limit
This commit is contained in:
parent
c923126eff
commit
2c1316a0a6
3 changed files with 53 additions and 18 deletions
|
|
@ -1,17 +1,13 @@
|
|||
{ config, pkgs, ... }:
|
||||
{ config, pkgs, lib, ... }:
|
||||
|
||||
let
|
||||
net = import ../config/network.nix;
|
||||
serv = import ../config/services.nix;
|
||||
serviceValidation = import ../validation/service/continuwuity.nix;
|
||||
|
||||
serverName =
|
||||
if net ? devices && builtins.isAttrs net.devices && net.devices ? remote_proxy && net.devices.remote_proxy ? domain && builtins.isString net.devices.remote_proxy.domain then
|
||||
net.devices.remote_proxy.domain
|
||||
else
|
||||
throw "config/network.nix must define devices.remote_proxy.domain as string for continuwuity.";
|
||||
serverName = serviceValidation.getServerName serv;
|
||||
|
||||
trustedServers = serviceValidation.getTrustedServers serv;
|
||||
memoryMax = serviceValidation.getMemoryMax serv;
|
||||
in
|
||||
{
|
||||
services.matrix-continuwuity = {
|
||||
|
|
@ -27,4 +23,9 @@ in
|
|||
};
|
||||
};
|
||||
};
|
||||
|
||||
systemd.services.matrix-continuwuity.serviceConfig =
|
||||
lib.optionalAttrs (memoryMax != null) {
|
||||
MemoryMax = memoryMax;
|
||||
};
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue