aboutsummaryrefslogtreecommitdiff
path: root/default.nix
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--default.nix28
1 files changed, 23 insertions, 5 deletions
diff --git a/default.nix b/default.nix
index 8e631bd..9002aec 100644
--- a/default.nix
+++ b/default.nix
@@ -27,7 +27,23 @@ let
SOCKET_IDLE_TIME = toString commonConfig.socketIdleTime;
};
- servicesBack = mapAttrs' (instanceName: instanceConfig: {
+ servicesBack = mapAttrs' (instanceName: instanceConfig:
+ if instanceConfig.exneuland.enable then {
+ name = "wa-exneuland-${instanceName}";
+ value = {
+ description = "Exneuland backend for ${instanceName}";
+ wantedBy = [ "multi-user.target" ];
+ after = [ "network.target" ];
+ serviceConfig = {
+ ExecStart =
+ "${instanceConfig.exneuland.package}/bin/exneuland start";
+ Restart = "always";
+ DynamicUser = true;
+ User = "exneuland-backend";
+ Group = "exneuland-backend";
+ };
+ };
+ } else {
name = "wa-back-${instanceName}";
value = mkIf instanceConfig.backend.enable {
description = "WorkAdventure backend ${instanceName}";
@@ -66,9 +82,9 @@ let
) instances;
servicesPusher = mapAttrs' (instanceName: instanceConfig:
- {
+ {
name = "wa-pusher-${instanceName}";
- value = mkIf instanceConfig.pusher.enable {
+ value = mkIf (instanceConfig.pusher.enable && !instanceConfig.exneuland.enable) {
description = "WorkAdventure pusher ${instanceName}";
wantedBy = [ "multi-user.target" ];
after = [ "network.target" ];
@@ -132,8 +148,10 @@ let
};
"/pusher/" = {
- #proxyPass = "http://10.233.3.1:9000";
- proxyPass = "http://localhost:${toString instanceConfig.pusher.port}/";
+ proxyPass =
+ if instanceConfig.exneuland.enable
+ then "http://localhost:4000"
+ else "http://localhost:${toString instanceConfig.pusher.port}/";
proxyWebsockets = true;
};