1
0
Fork 0
permafrost/modules/foundry.nix

43 lines
1.3 KiB
Nix

{ lib, config, ... }:
let
cfg = config.permafrost.foundry;
ACMEEnabled = config.nginx.enableACME;
in
{
options.permafrost.foundry = {
enable = lib.mkEnableOption "foundry nixos module";
};
config = lib.mkIf cfg.enable {
permafrost.nginx.enable = lib.mkDefault true;
permafrost.nginx.certDomains = lib.mkIf ACMEEnabled [ "scarlet.zynh.me" ];
services.nginx.virtualHosts."scarlet.zynh.me" = {
addSSL = true;
serverName = "scarlet.zynh.me";
useACMEHost = lib.mkIf ACMEEnabled "scarlet.zynh.me";
locations."/" = {
extraConfig = /* nginx */ ''
# Set proxy headers
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
# These are important to support WebSockets
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "Upgrade";
# Make sure to set your Foundry VTT port number
proxy_pass http://localhost:30000;
'';
proxyPass = "http://localhost:30000";
};
};
services.nginx.virtualHosts."ddbimporter.zynh.me" = {
addSSL = true;
serverName = "ddbimporter.zynh.me";
locations."/".proxyPass = "http://localhost:3232";
};
};
}