First working version of foundryvtt

This commit is contained in:
Cyryl Płotnicki 2022-06-18 09:21:51 +01:00
parent e3fa1bb08f
commit b579b307fd

View file

@ -6,36 +6,39 @@
"foundryvtt.peninsula.industries" = {
forceSSL = true;
enableACME = true;
locations."/" = {
proxyPass = "http://localhost:30000";
proxyWebsockets = true;
};
};
};
};
containers.foundryvtt = {
autoStart = true;
config = { config, pkgs, ... }: {
environment.systemPackages = with pkgs; [
(fetchzip {
forwardPorts = [{
containerPort = 30000;
hostPort = 30000;
}];
config = { config, pkgs, ... }:
let
foundryvtt = pkgs.fetchzip {
name = "foundryvtt";
url = "file:///" + ./FoundryVTT-9.269.zip;
postFetch = "";
sha256 = "sha256-7YlF3tQ0XsN8CJO7WrjAhz8rHdl/pgqGUpjIJJnB0Eg=";
stripRoot = false;
})
nodejs-18_x
];
systemd.services."foundryvtt" = {
requires = [ "network-online.target" ];
wantedBy = [ "multi-user.target" ];
serviceConfig = {
Restart = "on-failure";
ExecStart = "echo Hi, %u";
DynamicUser = "yes";
};
in {
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
'';
};
};
};
};
}