This repository has no description
1.0 kB
34 lines
1let
2 domain = "maze.lassul.us";
3 port = 8772;
4in
5{ self, ... }:
6{
7 # mazegame: Windows 95 "Maze" screensaver you can play in a browser tab. The
8 # exit is the NixOS snowflake. /watch is a spectator camera that follows a
9 # random player and cuts to the next one after 2s without movement.
10 imports = [ self.inputs.mazegame.nixosModules.default ];
11
12 services.mazegame = {
13 enable = true;
14 host = "127.0.0.1";
15 port = port;
16 };
17
18 services.nginx.virtualHosts.${domain} = {
19 enableACME = true;
20 forceSSL = true;
21 # Player and watcher sockets stay open for as long as someone is in the
22 # maze; players heartbeat every 3s, watchers every 3s, so the default
23 # 60s read timeout would only bite on a wedged client, but a long window
24 # keeps idle spectators connected.
25 locations."/" = {
26 proxyPass = "http://127.0.0.1:${toString port}";
27 proxyWebsockets = true;
28 extraConfig = ''
29 proxy_read_timeout 1h;
30 proxy_send_timeout 1h;
31 '';
32 };
33 };
34}