1 { config, lib, pkgs, ... }:
3 cfg = config.myServices.websites.games.terraforming-mars;
4 terraforming-mars = pkgs.callPackage ./terraforming-mars.nix {};
7 options.myServices.websites.games.terraforming-mars.enable = lib.mkEnableOption "Enable Terraforming mars game";
8 config = lib.mkIf cfg.enable {
9 myServices.chatonsProperties.services.terraforming-mars = {
10 file.datetime = "2022-08-27T14:20:00";
12 name = "Terraforming Mars";
13 description = "Terraforming Mars Boardgame";
14 website = "https://terraforming-mars.games.immae.eu/";
15 logo = "https://terraforming-mars.games.immae.eu/favicon.ico";
17 status.description = "OK";
18 registration."" = ["NONE"];
19 registration.load = "OPEN";
20 install.type = "PACKAGE";
23 name = "Terraforming Mars";
24 website = "https://github.com/terraforming-mars/terraforming-mars";
25 license.url = "https://github.com/terraforming-mars/terraforming-mars/blob/main/LICENSE";
26 license.name = "GNU General Public License v3.0";
27 version = "unversionned";
28 source.url = "https://github.com/terraforming-mars/terraforming-mars";
31 systemd.services.terraforming-mars = {
32 path = [ pkgs.nodejs pkgs.bashInteractive ];
33 description = "Terraforming mars game";
34 wantedBy = [ "multi-user.target" ];
36 export PORT=/run/terraforming-mars/socket.sock
37 export NODE_ENV=production
38 mkdir -p /var/lib/terraforming-mars/db
43 chown :wwwrun /run/terraforming-mars/socket.sock
44 chmod g+w /run/terraforming-mars/socket.sock
47 User = "terraformingmars";
49 SupplementaryGroups = [ "wwwrun" ];
51 WorkingDirectory = terraforming-mars;
52 RuntimeDirectory = "terraforming-mars";
53 StateDirectory = "terraforming-mars";
57 services.websites.env.tools.vhostConfs.games_terraforming-mars = {
59 certMainHost = "games.immae.eu";
60 hosts = [ "terraforming-mars.games.immae.eu" ];
64 ProxyPass / unix:///run/terraforming-mars/socket.sock|http://terraforming-mars.games.immae.eu/
65 ProxyPassReverse / unix:///run/terraforming-mars/socket.sock|http://terraforming-mars.games.immae.eu/