Nix: expose EVENT_TRANSMISSION as an option

This commit is contained in:
Rory&
2026-05-16 21:25:24 +02:00
committed by Rory&
parent e44d2423cd
commit 3bb13bdf76
+17 -3
View File
@@ -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";
}
);