{ 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"; 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}/bin/MatrixMediaGate"; ExecStartPre = "${pkgs.busybox}/bin/cp ${./appsettings.conduit-rory-gay.json} ./appsettings.conduit-rory-gay.json"; Restart = "always"; RestartSec = "5"; DynamicUser = true; StateDirectory = "matrix-media-gate"; WorkingDirectory = "/var/lib/matrix-media-gate"; }; environment = { "DOTNET_ENVIRONMENT" = "conduit-rory-gay"; "DOTNET_URLS" = "http://localhost:9002"; }; }; }; }