summary refs log tree commit diff
path: root/host/Rory-nginx/services/matrix/matrix-media-gate.nix
blob: 591e550e3452548ed8a1732142431a774c0ecd9a (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
{ config, pkgs, lib, MatrixMediaGate, ... }:

{
  systemd.services = {
    "MatrixMediaGate-matrix-rory-gay" = {
      wantedBy = [ "multi-user.target" ];
      serviceConfig = {
        ExecStart = "${MatrixMediaGate}/bin/MatrixMediaGate";
        ExecStartPre = "cp ${./appsettings.matrix-rory-gay.json} /etc/matrix-media-gate/appsettings.matrix-rory-gay.json";
        Restart = "always";
        RestartSec = "5";
        DynamicUser = true;
        StateDirectory = "matrix-media-gate";
      };
      environment = {
        "DOTNET_ENVIRONMENT" = "matrix-rory-gay";
        "DOTNET_URLS" = "http://localhost:9001";
      };
    };
    "MatrixMediaGate-conduit-rory-gay" = {
      wantedBy = [ "multi-user.target" ];
      serviceConfig = {
        ExecStart = "${MatrixMediaGate}/bin/MatrixMediaGate";
        ExecStartPre = "cp ${./appsettings.conduit-rory-gay.json} /etc/matrix-media-gate/appsettings.conduit-rory-gay.json";
        Restart = "always";
        RestartSec = "5";
        DynamicUser = true;
        StateDirectory = "matrix-media-gate";
      };
      environment = {
        "DOTNET_ENVIRONMENT" = "conduit-rory-gay";
        "DOTNET_URLS" = "http://localhost:9002";
      };
    };
  };
}