9 # This option enables the use of an experimental pure-Go implementation of
10 # the Olm protocol instead of libolm for end-to-end encryption. Using goolm
11 # is not recommended by the mautrix developers, but they are interested in
12 # people trying it out in non-production-critical environments and reporting
13 # any issues they run into.
18 pname = "mautrix-signal";
21 src = fetchFromGitHub {
25 hash = "sha256-1UI2oYDnmwy9+URBMA2yTBMEoFsE8qnkhn7E0l/lOTs=";
29 (lib.optional (!withGoolm) olm)
30 ++ (lib.optional withGoolm stdenv.cc.cc.lib)
32 # must match the version used in https://github.com/mautrix/signal/tree/main/pkg/libsignalgo
33 # see https://github.com/mautrix/signal/issues/401
37 tags = lib.optional withGoolm "goolm";
39 CGO_LDFLAGS = lib.optional withGoolm [ "-lstdc++" ];
41 vendorHash = "sha256-ADuW6KMNUwJeGqFlQsJ8qSI0alPQpSAFx1zrhwsAmsI=";
46 # Needed by the tests to be able to find libstdc++
47 export LD_LIBRARY_PATH="${stdenv.cc.cc.lib}/lib:$LD_LIBRARY_PATH"
49 + (lib.optionalString (!withGoolm) ''
50 # When using libolm, the tests need explicit linking to libstdc++
51 export CGO_LDFLAGS="-lstdc++"
58 doInstallCheck = true;
59 nativeInstallCheckInputs = [ versionCheckHook ];
60 versionCheckProgramArg = [ "--version" ];
63 homepage = "https://github.com/mautrix/signal";
64 description = "Matrix-Signal puppeting bridge";
65 license = licenses.agpl3Plus;
66 maintainers = with maintainers; [
70 mainProgram = "mautrix-signal";