diff --git a/nixos/boxes/vultr1/nginx.nix b/nixos/boxes/nginx.nix similarity index 100% rename from nixos/boxes/vultr1/nginx.nix rename to nixos/boxes/nginx.nix diff --git a/nixos/boxes/vpsfree1/default.nix b/nixos/boxes/vpsfree1/default.nix index a88894e4..fa5f7a35 100644 --- a/nixos/boxes/vpsfree1/default.nix +++ b/nixos/boxes/vpsfree1/default.nix @@ -8,6 +8,7 @@ ../../server-security.nix ../../server-common.nix ../../tailscale.nix + ./foundryvtt.nix ]; systemd.extraConfig = '' diff --git a/nixos/boxes/vpsfree1/foundryvtt.nix b/nixos/boxes/vpsfree1/foundryvtt.nix new file mode 100644 index 00000000..a8434620 --- /dev/null +++ b/nixos/boxes/vpsfree1/foundryvtt.nix @@ -0,0 +1,41 @@ +{ config, pkgs, inputs, lib, ... }: { + imports = [ ../nginx.nix ]; + + services.nginx = { + virtualHosts = { + "foundryvtt.peninsula.industries" = { + forceSSL = true; + enableACME = true; + }; + }; + }; + + containers.foundryvtt = { + autoStart = true; + config = { config, pkgs, ... }: { + environment.systemPackages = with 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"; + }; + }; + }; + + }; +} diff --git a/nixos/boxes/vultr1/default.nix b/nixos/boxes/vultr1/default.nix index 974aa6bc..a22e56c6 100644 --- a/nixos/boxes/vultr1/default.nix +++ b/nixos/boxes/vultr1/default.nix @@ -6,7 +6,7 @@ ./tailscale-vultr1.nix ./folding.nix ./matrix-front.nix - ./nginx.nix + ./../nginx.nix ./search.nix ./snowflake.nix ../cli.nix