summary refs log tree commit diff
path: root/host/Rory-nginx/services/matrix/matrix-media-gate.nix
blob: fbec107b0d8dcc089de57eb492d9a0e7f2b87109 (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
{ 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";
      };
    };
  };
}