nixos/matrix-synapse: use python to launch synapse

launch synapse with the python executable because the startup script is
no longer available
wip/yesman
nyanloutre 5 years ago
parent 863e49e3ee
commit eb753318b3
  1. 10
      nixos/modules/services/misc/matrix-synapse.nix

@ -651,12 +651,16 @@ in {
services.postgresql.enable = mkIf usePostgresql (mkDefault true);
systemd.services.matrix-synapse = {
systemd.services.matrix-synapse =
let
python = (pkgs.python3.withPackages (ps: with ps; [ (ps.toPythonModule cfg.package) ]));
in
{
description = "Synapse Matrix homeserver";
after = [ "network.target" "postgresql.service" ];
wantedBy = [ "multi-user.target" ];
preStart = ''
${cfg.package}/bin/homeserver \
${python.interpreter} -m synapse.app.homeserver \
--config-path ${configFile} \
--keys-directory ${cfg.dataDir} \
--generate-keys
@ -687,7 +691,7 @@ in {
WorkingDirectory = cfg.dataDir;
PermissionsStartOnly = true;
ExecStart = ''
${cfg.package}/bin/homeserver \
${python.interpreter} -m synapse.app.homeserver \
${ concatMapStringsSep "\n " (x: "--config-path ${x} \\") ([ configFile ] ++ cfg.extraConfigFiles) }
--keys-directory ${cfg.dataDir}
'';

Loading…
Cancel
Save