X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=modules%2Fprivate%2Fwebsites%2Ftools%2Fgames%2Fterraforming-mars%2Fdefault.nix;fp=modules%2Fprivate%2Fwebsites%2Ftools%2Fgames%2Fterraforming-mars%2Fdefault.nix;h=0000000000000000000000000000000000000000;hb=1a64deeb894dc95e2645a75771732c6cc53a79ad;hp=0df5363ae42fba9f2470ebb5561c853c3b290c3a;hpb=fa25ffd4583cc362075cd5e1b4130f33306103f0;p=perso%2FImmae%2FConfig%2FNix.git diff --git a/modules/private/websites/tools/games/terraforming-mars/default.nix b/modules/private/websites/tools/games/terraforming-mars/default.nix deleted file mode 100644 index 0df5363..0000000 --- a/modules/private/websites/tools/games/terraforming-mars/default.nix +++ /dev/null @@ -1,48 +0,0 @@ -{ config, lib, pkgs, ... }: -let - cfg = config.myServices.websites.games.terraforming-mars; - terraforming-mars = pkgs.callPackage ./terraforming-mars.nix {}; -in -{ - options.myServices.websites.games.terraforming-mars.enable = lib.mkEnableOption "Enable Terraforming mars game"; - config = lib.mkIf cfg.enable { - systemd.services.terraforming-mars = { - path = [ pkgs.nodejs pkgs.bashInteractive ]; - description = "Terraforming mars game"; - wantedBy = [ "multi-user.target" ]; - script = '' - export PORT=/run/terraforming-mars/socket.sock - export NODE_ENV=production - mkdir -p /var/lib/terraforming-mars/db - npm run start - ''; - postStart = '' - sleep 5; - chown :wwwrun /run/terraforming-mars/socket.sock - chmod g+w /run/terraforming-mars/socket.sock - ''; - serviceConfig = { - User = "terraformingmars"; - DynamicUser = true; - SupplementaryGroups = [ "wwwrun" ]; - Type = "simple"; - WorkingDirectory = terraforming-mars; - RuntimeDirectory = "terraforming-mars"; - StateDirectory = "terraforming-mars"; - }; - }; - - services.websites.env.tools.vhostConfs.games_terraforming-mars = { - certName = "games"; - certMainHost = "games.immae.eu"; - hosts = [ "terraforming-mars.games.immae.eu" ]; - root = null; - extraConfig = [ - '' - ProxyPass / unix:///run/terraforming-mars/socket.sock|http://terraforming-mars.games.immae.eu/ - ProxyPassReverse / unix:///run/terraforming-mars/socket.sock|http://terraforming-mars.games.immae.eu/ - '' - ]; - }; - }; -}