diff --git a/nix/modules/default/default.nix b/nix/modules/default/default.nix index 5602c2589..876ad941a 100644 --- a/nix/modules/default/default.nix +++ b/nix/modules/default/default.nix @@ -55,6 +55,20 @@ in description = "Path to store CDN files."; }; + ipcMethod = lib.mkOption { + type = lib.types.enum [ + "unix" + "rabbitmq-single" + "rabbitmq-legacy" + ]; + default = "unix"; + description = '' + How messages should be passed between services. + Note that the C# services (eg. Admin API) currently only supports the "unix" method! + Read more at https://docs.spacebar.chat/setup/server/installation/generic/ipc/. + ''; + }; + extraEnvironment = lib.mkOption { default = { }; description = '' @@ -98,7 +112,6 @@ in environment = builtins.mapAttrs (_: val: builtins.toString val) ( { # things we set by default... - EVENT_TRANSMISSION = "unix"; EVENT_SOCKET_PATH = "/run/spacebar/"; } // cfg.extraEnvironment @@ -108,6 +121,7 @@ in CONFIG_READONLY = 1; PORT = toString cfg.apiEndpoint.localPort; STORAGE_LOCATION = cfg.cdnPath; + EVENT_TRANSMISSION = cfg.ipcMethod; } ); serviceConfig = { @@ -121,7 +135,6 @@ in environment = builtins.mapAttrs (_: val: builtins.toString val) ( { # things we set by default... - EVENT_TRANSMISSION = "unix"; EVENT_SOCKET_PATH = "/run/spacebar/"; } // cfg.extraEnvironment @@ -131,6 +144,7 @@ in CONFIG_READONLY = 1; PORT = toString cfg.gatewayEndpoint.localPort; STORAGE_LOCATION = cfg.cdnPath; + EVENT_TRANSMISSION = cfg.ipcMethod; APPLY_DB_MIGRATIONS = "false"; } ); @@ -144,7 +158,6 @@ in environment = builtins.mapAttrs (_: val: builtins.toString val) ( { # things we set by default... - EVENT_TRANSMISSION = "unix"; EVENT_SOCKET_PATH = "/run/spacebar/"; } // cfg.extraEnvironment @@ -154,6 +167,7 @@ in CONFIG_READONLY = 1; PORT = toString cfg.cdnEndpoint.localPort; STORAGE_LOCATION = cfg.cdnPath; + EVENT_TRANSMISSION = cfg.ipcMethod; APPLY_DB_MIGRATIONS = "false"; } );