1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2024-09-11 15:08:33 +01:00

Merge pull request #56257 from pacien/synapse-0.99.1.1-homeserverscript

matrix-synapse: restore service wrapper script
This commit is contained in:
Léo Gaspard 2019-02-24 17:11:41 +01:00 committed by GitHub
commit 5fa2c13696
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 30 additions and 8 deletions

View file

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

View file

@ -30,6 +30,11 @@ in buildPythonApplication rec {
sha256 = "1ych13x3c2cam7af4q2ariwvzwvr65g3j2x8ajjn33ydwxxbqbg6";
};
patches = [
# adds an entry point for the service
./homeserver-script.patch
];
propagatedBuildInputs = [
bcrypt
bleach
@ -77,6 +82,6 @@ in buildPythonApplication rec {
homepage = https://matrix.org;
description = "Matrix reference homeserver";
license = licenses.asl20;
maintainers = with maintainers; [ ralith roblabla ekleog ];
maintainers = with maintainers; [ ralith roblabla ekleog pacien ];
};
}

View file

@ -0,0 +1,21 @@
diff --git a/homeserver b/homeserver
new file mode 120000
index 0000000..2f1d413
--- /dev/null
+++ b/homeserver
@@ -0,0 +1,1 @@
+synapse/app/homeserver.py
\ No newline at end of file
diff --git a/setup.py b/setup.py
index b00c2af..c7f6e0a 100755
--- a/setup.py
+++ b/setup.py
@@ -92,6 +92,6 @@ setup(
include_package_data=True,
zip_safe=False,
long_description=long_description,
- scripts=["synctl"] + glob.glob("scripts/*"),
+ scripts=["synctl", "homeserver"] + glob.glob("scripts/*"),
cmdclass={'test': TestCommand},
)