summary refs log tree commit diff
path: root/host/Rory-nginx/services/matrix/matrix-media-gate.nix
blob: 8c92a4c727ab93635294e52c3d79644579c56aea (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 = "${pkgs.busybox}/bin/cp ${./appsettings.matrix-rory-gay.json} ./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} ./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";
      };
    };
  };
}