2023-05-11 22:02:57 +01:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
config,
|
|
|
|
flake-inputs,
|
|
|
|
...
|
|
|
|
}: let
|
|
|
|
domain = "foundryvtt.${config.services.nginx.domain}";
|
|
|
|
in {
|
|
|
|
imports = [flake-inputs.foundryvtt.nixosModules.foundryvtt];
|
|
|
|
|
|
|
|
services.foundryvtt = {
|
|
|
|
enable = true;
|
|
|
|
hostName = domain;
|
|
|
|
minifyStaticFiles = true;
|
|
|
|
};
|
|
|
|
|
|
|
|
# Want to start it manually when I need it, not have it constantly
|
|
|
|
# running
|
|
|
|
systemd.services.foundryvtt.wantedBy = lib.mkForce [];
|
|
|
|
|
|
|
|
services.nginx.virtualHosts."${domain}" = let
|
|
|
|
inherit (config.services.foundryvtt) port;
|
|
|
|
in {
|
|
|
|
forceSSL = true;
|
|
|
|
enableACME = true;
|
|
|
|
extraConfig = ''
|
|
|
|
add_header Strict-Transport-Security "max-age=15552000; includeSubDomains" always;
|
2023-10-07 21:14:43 +01:00
|
|
|
access_log /var/log/nginx/${domain}/access.log upstream_time;
|
2023-05-11 22:02:57 +01:00
|
|
|
'';
|
|
|
|
|
|
|
|
locations."/" = {
|
|
|
|
proxyWebsockets = true;
|
|
|
|
proxyPass = "http://localhost:${toString port}";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|