diff options
author | Ismaël Bouya <ismael.bouya@normalesup.org> | 2023-10-04 01:35:06 +0200 |
---|---|---|
committer | Ismaël Bouya <ismael.bouya@normalesup.org> | 2023-10-04 02:11:48 +0200 |
commit | 1a64deeb894dc95e2645a75771732c6cc53a79ad (patch) | |
tree | 1b9df4838f894577a09b9b260151756272efeb53 /systems/eldiron/websites/games/codenames/default.nix | |
parent | fa25ffd4583cc362075cd5e1b4130f33306103f0 (diff) | |
download | Nix-1a64deeb894dc95e2645a75771732c6cc53a79ad.tar.gz Nix-1a64deeb894dc95e2645a75771732c6cc53a79ad.tar.zst Nix-1a64deeb894dc95e2645a75771732c6cc53a79ad.zip |
Squash changes containing private information
There were a lot of changes since the previous commit, but a lot of them
contained personnal information about users. All thos changes got
stashed into a single commit (history is kept in a different place) and
private information was moved in a separate private repository
Diffstat (limited to 'systems/eldiron/websites/games/codenames/default.nix')
-rw-r--r-- | systems/eldiron/websites/games/codenames/default.nix | 76 |
1 files changed, 76 insertions, 0 deletions
diff --git a/systems/eldiron/websites/games/codenames/default.nix b/systems/eldiron/websites/games/codenames/default.nix new file mode 100644 index 0000000..7f09cc3 --- /dev/null +++ b/systems/eldiron/websites/games/codenames/default.nix | |||
@@ -0,0 +1,76 @@ | |||
1 | { config, lib, pkgs, ... }: | ||
2 | let | ||
3 | greenapid = pkgs.callPackage ./greenapid.nix {}; | ||
4 | frontend = pkgs.callPackage ./frontend.nix { nodeEnv = pkgs.callPackage pkgs.mylibs.nodeEnv {}; }; | ||
5 | wordlists = pkgs.runCommand "wordlists" {} '' | ||
6 | mkdir -p $out | ||
7 | cp -r ${./wordlists} $out/wordlists | ||
8 | ''; | ||
9 | cfg = config.myServices.websites.games.codenames; | ||
10 | in | ||
11 | { | ||
12 | options.myServices.websites.games.codenames.enable = lib.mkEnableOption "Enable Codenames game"; | ||
13 | config = lib.mkIf cfg.enable { | ||
14 | myServices.dns.zones."immae.eu".subdomains.games.subdomains.codenames = with config.myServices.dns.helpers; | ||
15 | ips servers.eldiron.ips.main; | ||
16 | |||
17 | myServices.chatonsProperties.services.codenames = { | ||
18 | file.datetime = "2022-08-27T14:08:00"; | ||
19 | service = { | ||
20 | name = "Codenames Green"; | ||
21 | description = "Co-op codenames app"; | ||
22 | website = "https://codenames.games.immae.eu/"; | ||
23 | logo = "https://codenames.games.immae.eu/images/apple-touch-icon.png"; | ||
24 | status.level = "OK"; | ||
25 | status.description = "OK"; | ||
26 | registration."" = ["NONE"]; | ||
27 | registration.load = "OPEN"; | ||
28 | install.type = "PACKAGE"; | ||
29 | }; | ||
30 | software = { | ||
31 | name = "Codenames Green"; | ||
32 | website = "https://www.codenamesgreen.com/"; | ||
33 | license.url = "https://github.com/jbowens/codenamesgreen/blob/master/package.json"; | ||
34 | license.name = "MIT"; | ||
35 | version = greenapid.version; | ||
36 | source.url = "https://github.com/jbowens/codenamesgreen"; | ||
37 | }; | ||
38 | }; | ||
39 | systemd.services.codenames_api = { | ||
40 | description = "Api for codenames game"; | ||
41 | wantedBy = [ "multi-user.target" ]; | ||
42 | script = "${greenapid}/bin/greenapid"; | ||
43 | postStart = '' | ||
44 | sleep 5; | ||
45 | chown :wwwrun /run/codenamesgreen/socket.sock | ||
46 | chmod g+w /run/codenamesgreen/socket.sock | ||
47 | ''; | ||
48 | serviceConfig = { | ||
49 | User = "codenames"; | ||
50 | DynamicUser = true; | ||
51 | SupplementaryGroups = [ "wwwrun" ]; | ||
52 | Type = "simple"; | ||
53 | RuntimeDirectory = "codenamesgreen"; | ||
54 | WorkingDirectory = builtins.toString wordlists; | ||
55 | }; | ||
56 | }; | ||
57 | |||
58 | security.acme.certs.games.domain = "games.immae.eu"; | ||
59 | security.acme.certs.games.extraDomainNames = [ "codenames.games.immae.eu" ]; | ||
60 | services.websites.env.tools.vhostConfs.games_codenames = { | ||
61 | certName = "games"; | ||
62 | hosts = [ "codenames.games.immae.eu" ]; | ||
63 | root = frontend; | ||
64 | extraConfig = [ | ||
65 | '' | ||
66 | ProxyPass /api/ unix:///run/codenamesgreen/socket.sock|http://codenames.games.immae.eu/ | ||
67 | ProxyPassReverse /api/ unix:///run/codenamesgreen/socket.sock|http://codenames.games.immae.eu/ | ||
68 | |||
69 | <Directory ${frontend}> | ||
70 | FallbackResource index.html | ||
71 | </Directory> | ||
72 | '' | ||
73 | ]; | ||
74 | }; | ||
75 | }; | ||
76 | } | ||