From 40fd4b653d5b4ab37a133d7068280ffca86d40e6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cyryl=20P=C5=82otnicki?= Date: Sat, 20 Aug 2022 10:38:35 +0100 Subject: [PATCH] add test foundry instance --- nixos/boxes/vpsfree1/foundryvtt.nix | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/nixos/boxes/vpsfree1/foundryvtt.nix b/nixos/boxes/vpsfree1/foundryvtt.nix index 002e54b1..72f17467 100644 --- a/nixos/boxes/vpsfree1/foundryvtt.nix +++ b/nixos/boxes/vpsfree1/foundryvtt.nix @@ -23,7 +23,7 @@ in { }; }; virtualHosts = { - "foundryvtt1.peninsula.industries" = { + "foundryvtt-test.peninsula.industries" = { forceSSL = true; enableACME = true; locations."/" = { @@ -58,4 +58,22 @@ in { }; }; }; + containers.foundryvtt-test = { + 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"; + }; + }; + }; }