This repository has no description
1.5 kB
38 lines
1let
2 domain = "quiz.nixcon.org";
3 port = 8773;
4in
5{ self, ... }:
6{
7 # nixcon-quiz: live multiplayer quiz for NixCon. Everyone answers the same
8 # question against the same server clock; /spectate is the 16:9 screen for
9 # the livestream with a QR code to join.
10 #
11 # The questions are not part of any repository (whoever reads them knows
12 # every answer) and stay out of the world-readable store. Copy them over
13 # after deploying; until then the service is skipped:
14 # rsync -r --delete ~/src/nixcon-quiz/questions/ root@neoprism.r:/var/lib/nixcon-quiz/questions/
15 # ssh root@neoprism.r systemctl restart nixcon-quiz
16 # Break slides for /spectate (PDF/PNG/JPEG/WebP, not in any repository
17 # either) are picked up without a restart:
18 # rsync -r --delete ~/src/nixcon-quiz/slides/ root@neoprism.r:/var/lib/nixcon-quiz/slides/
19 imports = [ self.inputs.nixcon-quiz.nixosModules.default ];
20
21 services.nixcon-quiz = {
22 enable = true;
23 host = "127.0.0.1";
24 inherit port domain;
25 questionSeconds = 30;
26 };
27
28 # No per-address limits on the event streams: the venue Wi-Fi puts every
29 # phone at NixCon behind one public address, so a per-IP cap cuts off
30 # everyone past the first few players. The quiz caps players itself.
31
32 # The quiz's first home; old links and QR codes land on the new name.
33 services.nginx.virtualHosts."quiz.lassul.us" = {
34 enableACME = true;
35 forceSSL = true;
36 globalRedirect = domain;
37 };
38}