add nginx

This commit is contained in:
stubbfelnewpc
2022-08-30 21:04:56 +00:00
parent f9652b6d3b
commit d211d67165
3 changed files with 50 additions and 6 deletions

32
examples/unciv-nixos.nix Normal file
View File

@@ -0,0 +1,32 @@
# nix-build '<nixpkgs/nixos>' -A vm -I nixos-config="examples/unciv-nixos.nix" && result/bin/run-nixos-vm -nographic
{ config, pkgs, ... }:
let
uc = pkgs.callPackage ../unciv.nix {
port = "7443";
nginxEnableACME = false;
nginxForceSSL = false;
};
in
{
networking.firewall.allowedTCPPorts = [ 80 443 ];
services.nginx = {
enable = true;
appendHttpConfig = ''
server_names_hash_bucket_size 64;
'';
sslProtocols = "TLSv1 TLSv1.1 TLSv1.2";
recommendedGzipSettings = true;
recommendedOptimisation = true;
recommendedProxySettings = true;
recommendedTlsSettings = false;
virtualHosts."unciv.*" = uc.nginx.virtualHosts.unciv;
};
systemd.services.unciv = uc.systemd.services.unciv;
users.users.root.initialPassword = "root";
}