aboutsummaryrefslogtreecommitdiff
path: root/workadventure.nix
diff options
context:
space:
mode:
authorstuebinm2021-02-25 22:52:38 +0100
committerstuebinm2021-02-25 22:53:37 +0100
commit939cad8f30a7621162c104149b48211f3755636f (patch)
tree785e136e7ca24b35fda62745d23f6cf0047cbb15 /workadventure.nix
parent791fe2dce2374e1ff8b1cf4dc54bf9aac2b5c8a8 (diff)
Version bump to current coding machine master
This broke a lot of things, but possibly they might work again now.
Diffstat (limited to '')
-rw-r--r--workadventure.nix32
1 files changed, 28 insertions, 4 deletions
diff --git a/workadventure.nix b/workadventure.nix
index 189921c..b1aec77 100644
--- a/workadventure.nix
+++ b/workadventure.nix
@@ -6,6 +6,22 @@ with lib;
let
cfg = config.services.workadventure;
+
+ workadventureOverlay = let
+ src = "/home/stuebinm/Dokumente/Nous Sommes l'Utopie/hacc/workadventure/workadventure-nix";
+ #src = pkgs.fetchgit {
+ # url = "https://gitlab.infra4future.de/stuebinm/workadventure-nix";
+ # rev = "7ec4c291d8ec93bc205af5c238dfe6a5176f4da4";
+ # sha256 = "1372iwwbw7ji3v1wx3ncx9xiwnmjhahb8ivxcg8ykkci80hj0ci5";
+ #};
+ in import "${src}/overlay.nix";
+
+ urls = instanceConfig: if instanceConfig.nginx.domain != null then {
+ api = instanceConfig.nginx.domain + instanceConfig.frontend.urls.api;
+ uploader = instanceConfig.nginx.domain + instanceConfig.frontend.urls.uploader;
+ admin = instanceConfig.nginx.domain + instanceConfig.frontend.urls.admin;
+ maps = instanceConfig.nginx.domain + instanceConfig.frontend.urls.maps;
+ } else instanceConfig.urls;
servicesBack = mapAttrs' (instanceName: instanceConfig: {
name = "wa-back-${instanceName}";
@@ -31,6 +47,9 @@ let
environment = {
HTTP_PORT = toString instanceConfig.backend.httpPort;
GRPC_PORT = toString instanceConfig.backend.grpcPort;
+ #ADMIN_API_TOKEN = "lalala";
+ #ADMIN_API_URL = toString (urls instanceConfig).admin;
+ #ALLOW_ARTILLERY = "true";
};
serviceConfig = {
User = "workadventure-backend";
@@ -56,6 +75,8 @@ let
environment = {
PUSHER_HTTP_PORT = toString instanceConfig.pusher.port;
API_URL = "localhost:${toString instanceConfig.backend.grpcPort}";
+ #ADMIN_API_URL = toString (urls instanceConfig).admin;
+ #ADMIN_API_TOKEN = "lalala";
};
serviceConfig = {
User = "workadventure-pusher";
@@ -71,10 +92,10 @@ let
frontPackage = mapAttrs (instanceName: instanceConfig:
instanceConfig.frontend.package.override {
settings = {
- apiUrl = instanceConfig.frontend.urls.api;
- uploaderUrl = instanceConfig.frontend.urls.uploader;
- adminUrl = instanceConfig.frontend.urls.admin;
- mapsUrl = instanceConfig.frontend.urls.maps;
+ apiUrl = (urls instanceConfig).api;
+ uploaderUrl = (urls instanceConfig).uploader;
+ adminUrl = (urls instanceConfig).admin;
+ mapsUrl = (urls instanceConfig).maps;
} // instanceConfig.frontend.settings;
}
) cfg.instances;
@@ -90,7 +111,9 @@ let
};
"/pusher/" = {
+ #proxyPass = "http://10.233.3.1:9000";
proxyPass = "http://localhost:${toString instanceConfig.pusher.port}/";
+ proxyWebsockets = true;
};
"/maps/" = mkIf instanceConfig.nginx.serveDefaultMaps {
@@ -134,5 +157,6 @@ in {
inherit virtualHosts;
enable = mkDefault true;
};
+ nixpkgs.overlays = [ workadventureOverlay ];
};
}