Skip to content

Commit

Permalink
Fix synapse config not being optional
Browse files Browse the repository at this point in the history
Signed-off-by: magic_rb <[email protected]>
  • Loading branch information
MagicRB committed Oct 7, 2023
1 parent c12525e commit 730d44b
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions modules/services/synapse.nix
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,13 @@ let
makeSearchPathOutput
listToAttrs
mkEnableOption
optional
;

configFormat = pkgs.formats.yaml {};

workerDefaults = { config, name, ... }: {
package = mkDefault cfg.main.package;
package = mkDefault cfg.package;
settings = mapAttrs (_: mkDefault) {
worker_replication_host = "127.0.0.1";
worker_replication_http_port = 9093;
Expand All @@ -45,7 +46,7 @@ let
};

mainDefaults = { config, name, ... }: {
package = pkgs.matrix-synapse;
package = mkDefault pkgs.matrix-synapse;
};

instanceSubmodule =
Expand Down Expand Up @@ -91,10 +92,10 @@ let
shutdownOnExit = true;
script = pkgs.writeShellScript "synapse-worker-${name}.sh"
''
${pkgs.matrix-synapse}/bin/synapse_worker \
${concatStringsSep " " (flip mapAttrsToList cfg.arguments (n: v:
${cfg.package}/bin/synapse_worker \
${concatStringsSep "\\\n" (flip mapAttrsToList cfg.arguments (n: v:
if isList v then
concatMapStringsSep " " (x: "--${n} \"${x}\"") v
concatMapStringsSep "\\\n" (x: "--${n} \"${x}\"") v
else
"--${n} \"${v}\""))}
'';
Expand Down Expand Up @@ -134,11 +135,11 @@ in
"synapse-worker-${name}"
(synapseService name value)

)) ++ [
)) ++ (optional cfg.enable
(nameValuePair
"synapse"
(synapseService "main" cfg))
]
)
);
};
}

0 comments on commit 730d44b

Please sign in to comment.