1
1
mirror of https://github.com/dali99/nixos-matrix-modules.git synced 2024-12-22 02:47:29 +01:00

nginx: make upstream generator check empty attrset rather than empty list

This commit is contained in:
Daniel Lovbrotte Olsen 2022-12-19 21:04:15 +01:00
parent 43dbc17526
commit f42306e0a2

View File

@ -153,7 +153,7 @@ in
servers = let
fedReceivers = getWorkersOfType "fed-receiver";
socketAddresses = generateSocketAddresses "federation" fedReceivers;
in if fedReceivers != [ ] then
in if fedReceivers != { } then
lib.genAttrs socketAddresses (_: { })
else config.services.nginx.upstreams.synapse_master.servers;
extraConfig = ''
@ -166,7 +166,7 @@ in
servers = let
initialSyncers = getWorkersOfType "initial-sync";
socketAddresses = generateSocketAddresses "client" initialSyncers;
in if initialSyncers != [ ] then
in if initialSyncers != { } then
lib.genAttrs socketAddresses (_: { })
else config.services.nginx.upstreams.synapse_master.servers;
extraConfig = ''
@ -179,7 +179,7 @@ in
servers = let
normalSyncers = getWorkersOfType "normal-sync";
socketAddresses = generateSocketAddresses "client" normalSyncers;
in if normalSyncers != [ ] then
in if normalSyncers != { } then
lib.genAttrs socketAddresses (_: { })
else config.services.nginx.upstreams.synapse_master.servers;
extraConfig = ''
@ -192,7 +192,7 @@ in
servers = let
workers = getWorkersOfType "user-dir";
socketAddresses = generateSocketAddresses "client" workers;
in if workers != [ ] then
in if workers != { } then
lib.genAttrs socketAddresses (_: { })
else config.services.nginx.upstreams.synapse_master.servers;
};