summaryrefslogtreecommitdiff
path: root/hosts/chaski/services/exneuland.nix
diff options
context:
space:
mode:
authorstuebinm2021-08-19 19:34:15 +0200
committerstuebinm2021-08-19 19:34:15 +0200
commit430fdd501c2017b125e75b2e55358a51216b45ab (patch)
tree29be3196370b11b0ceee0dbd15e6bc1458b8dddf /hosts/chaski/services/exneuland.nix
parentb9a5df8499e8ca78a4b67d022f5bd110a2a2a859 (diff)
workadventure: use exneuland backend
Diffstat (limited to 'hosts/chaski/services/exneuland.nix')
-rw-r--r--hosts/chaski/services/exneuland.nix50
1 files changed, 50 insertions, 0 deletions
diff --git a/hosts/chaski/services/exneuland.nix b/hosts/chaski/services/exneuland.nix
new file mode 100644
index 0000000..a0c765a
--- /dev/null
+++ b/hosts/chaski/services/exneuland.nix
@@ -0,0 +1,50 @@
+{ config, lib, pkgs, ... }:
+
+let
+ workadventure-nix = builtins.fetchGit {
+ url = "https://stuebinm.eu/git/workadventure-nix";
+ ref = "master";
+ };
+ wapkgs = import "${workadventure-nix.outPath}/wapkgs.nix" {
+ inherit pkgs;
+ lib = pkgs.lib;
+ };
+ frontdrv = wapkgs.workadventure-tcm.front.override {
+ environment = {
+ PUSHER_URL = "https://exneuland.stuebinm.eu/pusher";
+ START_ROOM_URL = "/_/global/world.di.c3voc.de/maps/main.json";
+ };
+ };
+ exneuland = import ../../../pkgs/exneuland.nix;
+in
+{
+ services.nginx = {
+ enable = true;
+ recommendedProxySettings = true;
+ virtualHosts."exneuland.stuebinm.eu" = {
+ root = "${frontdrv}/dist";
+ locations."/_/".tryFiles = "/index.html =404";
+
+ locations."/pusher" = {
+ proxyPass = "http://localhost:4000";
+ proxyWebsockets = true;
+ extraConfig = ''
+ add_header Access-Control-Allow-Origin https://exneuland.stuebinm.eu;
+ '';
+ };
+
+ enableACME = true;
+ forceSSL = true;
+ };
+ };
+
+ systemd.services.exneuland = {
+ wantedBy = [ "multi-user.target" ];
+ after = [ "network.target" ];
+ description = "exneuland backend for workadventure";
+ serviceConfig = {
+ ExecStart = "${exneuland}/bin/exneuland start";
+ Restart = "always";
+ };
+ };
+}