1 import ../make-test-python.nix (
4 pantalaimonInstanceName = "testing";
6 # Set up SSL certs for Synapse to be happy.
7 runWithOpenSSL = file: cmd: pkgs.runCommand file
9 buildInputs = [ pkgs.openssl ];
13 ca_key = runWithOpenSSL "ca-key.pem" "openssl genrsa -out $out 2048";
14 ca_pem = runWithOpenSSL "ca.pem" ''
16 -x509 -new -nodes -key ${ca_key} \
17 -days 10000 -out $out -subj "/CN=snakeoil-ca"
19 key = runWithOpenSSL "matrix_key.pem" "openssl genrsa -out $out 2048";
20 csr = runWithOpenSSL "matrix.csr" ''
23 -out $out -subj "/CN=localhost" \
25 cert = runWithOpenSSL "matrix_cert.pem" ''
28 -CA ${ca_pem} -CAkey ${ca_key} \
29 -CAcreateserial -out $out \
35 meta = with pkgs.lib; {
36 maintainers = teams.matrix.members;
39 nodes.machine = { pkgs, ... }: {
40 services.pantalaimon-headless.instances.${pantalaimonInstanceName} = {
41 homeserver = "https://localhost:8448";
42 listenAddress = "0.0.0.0";
48 services.matrix-synapse = {
72 database.name = "sqlite3";
73 tls_certificate_path = "${cert}";
74 tls_private_key_path = "${key}";
81 machine.wait_for_unit("pantalaimon-${pantalaimonInstanceName}.service")
82 machine.wait_for_unit("matrix-synapse.service")
83 machine.wait_until_succeeds(
84 "curl --fail -L http://localhost:8888/"