tvl-depot/ops/modules/tvl-sso/default.nix
Luke Granger-Brown febf340303 fix(tvl-sso): set memory limit to 512M
This is because I'm bored of CAS gradually consuming all the RAM on Whitby.

Change-Id: Idcc14c19d99a6d3553739c5765be3faf2bdf9d84
Reviewed-on: https://cl.tvl.fyi/c/depot/+/3233
Tested-by: BuildkiteCI
Reviewed-by: grfn <grfn@gws.fyi>
Reviewed-by: tazjin <mail@tazj.in>
2021-08-24 16:28:14 +00:00

28 lines
758 B
Nix

# Configures an Apereo CAS instance for TVL SSO
{ depot, ... }:
let
inherit (depot.third_party) apereo-cas;
in {
config = {
environment.systemPackages = [ apereo-cas ];
systemd.services.apereo-cas = {
description = "Apereo CAS Single Sign On server";
wantedBy = [ "multi-user.target" ];
after = [ "network.target" ];
environment.JDK_JAVA_OPTIONS = "-Xmx512M -Xms512M";
serviceConfig = {
User = "apereo-cas";
Group = "apereo-cas";
ExecStart = "${apereo-cas}/bin/cas";
EnvironmentFile = "/etc/cas/secrets";
Restart = "always";
};
};
users.users.apereo-cas = {
isSystemUser = true;
group = "apereo-cas";
};
users.groups.apereo-cas = {};
};
}