74 lines
1.9 KiB
Nix
74 lines
1.9 KiB
Nix
{ config, pkgs, inputs, lib, ... }:
|
|
let
|
|
foundryvtt = pkgs.fetchzip {
|
|
name = "foundryvtt";
|
|
url = "file:///" + ./FoundryVTT-9.269.zip;
|
|
postFetch = "";
|
|
sha256 = "sha256-7YlF3tQ0XsN8CJO7WrjAhz8rHdl/pgqGUpjIJJnB0Eg=";
|
|
stripRoot = false;
|
|
};
|
|
in {
|
|
imports = [ ../nginx.nix ];
|
|
|
|
services.nginx = {
|
|
clientMaxBodySize = "300M";
|
|
virtualHosts = {
|
|
"foundryvtt.peninsula.industries" = {
|
|
forceSSL = true;
|
|
enableACME = true;
|
|
locations."/" = {
|
|
proxyPass = "http://localhost:30000";
|
|
proxyWebsockets = true;
|
|
};
|
|
};
|
|
};
|
|
virtualHosts = {
|
|
"foundryvtt1.peninsula.industries" = {
|
|
forceSSL = true;
|
|
enableACME = true;
|
|
locations."/" = {
|
|
proxyPass = "http://localhost:30001";
|
|
proxyWebsockets = true;
|
|
};
|
|
};
|
|
};
|
|
};
|
|
|
|
containers.foundryvtt1 = {
|
|
autoStart = true;
|
|
forwardPorts = [{
|
|
containerPort = 30001;
|
|
hostPort = 30001;
|
|
}];
|
|
config = { config, pkgs, ... }: {
|
|
systemd.services."foundryvtt" = {
|
|
requires = [ "network-online.target" ];
|
|
wantedBy = [ "multi-user.target" ];
|
|
script = ''
|
|
mkdir -p /var/lib/foundryvtt
|
|
${pkgs.nodejs-18_x}/bin/node ${foundryvtt}/resources/app/main.js --dataPath=/var/lib/foundryvtt --port=30001
|
|
'';
|
|
serviceConfig.Restart = "always";
|
|
};
|
|
};
|
|
};
|
|
|
|
containers.foundryvtt = {
|
|
autoStart = true;
|
|
forwardPorts = [{
|
|
containerPort = 30000;
|
|
hostPort = 30000;
|
|
}];
|
|
config = { config, pkgs, ... }: {
|
|
systemd.services."foundryvtt" = {
|
|
requires = [ "network-online.target" ];
|
|
wantedBy = [ "multi-user.target" ];
|
|
script = ''
|
|
mkdir -p /var/lib/foundryvtt
|
|
${pkgs.nodejs-18_x}/bin/node ${foundryvtt}/resources/app/main.js --dataPath=/var/lib/foundryvtt
|
|
'';
|
|
serviceConfig.Restart = "always";
|
|
};
|
|
};
|
|
};
|
|
}
|