Files
hearth/nixos/system/hectic-lab/mechabellum.nix
T
2026-06-07 23:14:14 +00:00

49 lines
939 B
Nix

{
inputs,
domain,
...
}: {
pkgs,
...
}: let
mechDomain = "mechabellum.${domain}";
apiHost = "127.0.0.1";
apiPort = 8010;
system = pkgs.stdenv.hostPlatform.system;
in {
imports = [
inputs.mechabellum-replay-analysis.nixosModules.default
];
mechabellum.api = {
enable = true;
host = apiHost;
port = apiPort;
extraEnvironment = {
CORS_ALLOWED_ORIGINS = "https://${mechDomain}";
};
};
mechabellum.worker = {
enable = true;
};
services.nginx.virtualHosts."${mechDomain}" = {
enableACME = true;
forceSSL = true;
root = inputs.mechabellum-replay-analysis.packages.${system}.frontend;
locations."/api" = {
proxyPass = "http://${apiHost}:${builtins.toString apiPort}";
extraConfig = ''
proxy_http_version 1.1;
client_max_body_size 500M;
'';
};
locations."/" = {
tryFiles = "$uri $uri/ /index.html";
};
};
}