summary refs log tree commit diff
path: root/host/Rory-nginx/services/matrix/matrix-media-gate.nix
blob: 7eb599c592a43d68523677d17eaaa717c2a6ae0d (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
38
39
40
41
42
43
44
45
46
{
  config,
  pkgs,
  lib,
  MatrixMediaGate,
  ...
}:

{
  systemd.services = {
    "MatrixMediaGate-matrix-rory-gay" = {
      wantedBy = [ "multi-user.target" ];
      serviceConfig = {
        ExecStart = "${MatrixMediaGate.packages.x86_64-linux.default}/bin/MatrixMediaGate";
        ExecStartPre = "${pkgs.busybox}/bin/cp ${./appsettings.matrix-rory-gay.json} ./appsettings.matrix-rory-gay.json";
        Restart = "always";
        RestartSec = "5";
        Type = "notify";
        DynamicUser = true;
        StateDirectory = "matrix-media-gate";
        WorkingDirectory = "/var/lib/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.packages.x86_64-linux.default}/bin/MatrixMediaGate";
        ExecStartPre = "${pkgs.busybox}/bin/cp ${./appsettings.conduit-rory-gay.json} ./appsettings.conduit-rory-gay.json";
        Restart = "always";
        RestartSec = "5";
        Type = "notify";
        DynamicUser = true;
        StateDirectory = "matrix-media-gate";
        WorkingDirectory = "/var/lib/matrix-media-gate";
      };
      environment = {
        "DOTNET_ENVIRONMENT" = "conduit-rory-gay";
        "DOTNET_URLS" = "http://localhost:9002";
      };
    };
  };
}