From 89ae33930e03df2928c4b2ebeccc1d64962e0c92 Mon Sep 17 00:00:00 2001 From: Fiona Grzebien Date: Fri, 8 Nov 2024 01:45:53 +0100 Subject: [PATCH] WIP mas --- config/hosts/matrix/mas.nix | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/config/hosts/matrix/mas.nix b/config/hosts/matrix/mas.nix index 4750b5f..0032ca2 100644 --- a/config/hosts/matrix/mas.nix +++ b/config/hosts/matrix/mas.nix @@ -1,6 +1,29 @@ { pkgs, ... }: +let + masConfig = (pkgs.formats.yaml { }).generate "matrix-authentication-service-config.yaml" { + + }; +in { environment.systemPackages = with pkgs; [ matrix-authentication-service ]; + + systemd.services.matrix-authentication-service = { + description = "Matrix Authentication Service"; + after = [ "postgresql.service" ]; + + serviceConfig = { + Type = "simple"; + ExecReload = "${pkgs.util-linux}/bin/kill -HUP $MAINPID"; + Restart = "on-abort"; + User = "mas"; + Group = "nogroup"; + WorkingDirectory = pkgs.matrix-authentication-service; + ExecStart = "${pkgs.matrix-authentication-service}/bin/mas-cli server --config=${masConfig}"; + SyslogIdentifier = "matrix-authentication-service"; + }; + + wantedBy = [ "multi-user.target" ]; + }; }