summary refs log tree commit diff
path: root/host/Rory-ovh/services/matrix/draupnir.nix
diff options
context:
space:
mode:
Diffstat (limited to 'host/Rory-ovh/services/matrix/draupnir.nix')
-rwxr-xr-xhost/Rory-ovh/services/matrix/draupnir.nix37
1 files changed, 36 insertions, 1 deletions
diff --git a/host/Rory-ovh/services/matrix/draupnir.nix b/host/Rory-ovh/services/matrix/draupnir.nix

index f754809..9a7c292 100755 --- a/host/Rory-ovh/services/matrix/draupnir.nix +++ b/host/Rory-ovh/services/matrix/draupnir.nix
@@ -1,4 +1,4 @@ -{ pkgs, draupnir, ... }: +{ config, lib, pkgs, draupnir, ... }: { services.draupnir = { @@ -70,4 +70,39 @@ }; }; }; + + systemd.services."draupnir" = { + serviceConfig = let + cfg = config.services.draupnir; + format = pkgs.formats.yaml { }; + configFile = format.generate "draupnir.yaml" cfg.settings; + in { + ExecStart = lib.mkForce ( + toString ( + [ + (lib.getExe cfg.package) + "--draupnir-config" + configFile + ] + ++ lib.optionals (cfg.secrets.accessToken != null) [ + "--access-token-path" + "%d/access_token" + ] + ++ lib.optionals (cfg.secrets.pantalaimon.password != null) [ + "--pantalaimon-password-path" + "%d/pantalaimon_password" + ] + ++ lib.optionals (cfg.secrets.web.synapseHTTPAntispam.authorization != null) [ + "--http-antispam-authorization-path" + "%d/http_antispam_authorization" + ] + ++ [ + "--max-old-space-size=32768" + "--max-semi-space-size=256" + "--prof" + ] + ) + ); + }; + }; }