summary refs log tree commit diff
path: root/nixos/modules
diff options
context:
space:
mode:
authorLéo Gaspard <leo@gaspard.io>2019-02-07 17:12:04 +0100
committerLéo Gaspard <leo@gaspard.io>2019-02-07 17:12:04 +0100
commita59a9a7e603f1aa3a1d499dfbc58a6712a244c6c (patch)
tree062ef89016acc1cf230b4362790254bb8bb5a725 /nixos/modules
parent6a0d2ff7c1d024914a3570b85f1c88df8930b471 (diff)
parente088eb34d93b0adcdfd46adf7eb7c35bcde346fc (diff)
downloadnixpkgs-a59a9a7e603f1aa3a1d499dfbc58a6712a244c6c.tar
nixpkgs-a59a9a7e603f1aa3a1d499dfbc58a6712a244c6c.tar.gz
nixpkgs-a59a9a7e603f1aa3a1d499dfbc58a6712a244c6c.tar.bz2
nixpkgs-a59a9a7e603f1aa3a1d499dfbc58a6712a244c6c.tar.lz
nixpkgs-a59a9a7e603f1aa3a1d499dfbc58a6712a244c6c.tar.xz
nixpkgs-a59a9a7e603f1aa3a1d499dfbc58a6712a244c6c.tar.zst
nixpkgs-a59a9a7e603f1aa3a1d499dfbc58a6712a244c6c.zip
Merge branch 'pr-55320'
* pr-55320:
  nixos/release-notes: mention breaking changes with matrix-synapse update
  nixos/matrix-synapse: reload service with SIGHUP
  nixos/tests/matrix-synapse: generate ca and certificates
  nixos/matrix-synapse: use python to launch synapse
  pythonPackages.pymacaroons-pynacl: remove unmaintained fork
  matrix-synapse: 0.34.1.1 -> 0.99.0
  pythonPackages.pymacaroons: init at 0.13.0
Diffstat (limited to 'nixos/modules')
-rw-r--r--nixos/modules/services/misc/matrix-synapse.nix11
1 files changed, 8 insertions, 3 deletions
diff --git a/nixos/modules/services/misc/matrix-synapse.nix b/nixos/modules/services/misc/matrix-synapse.nix
index 18e13f6ac03..a01e34d7362 100644
--- a/nixos/modules/services/misc/matrix-synapse.nix
+++ b/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,10 +691,11 @@ 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}
         '';
+        ExecReload = "${pkgs.utillinux}/bin/kill -HUP $MAINPID";
         Restart = "on-failure";
       };
     };