blob: db9df9ae0acd4569e7f7e4d0446ddf97fde0ec11 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
|
{ pkgs, conduit, ... }:
{
services.matrix-conduit = {
package = conduit.packages.${pkgs.system}.default;
enable = true;
settings.global = {
address = "127.0.0.1";
server_name = "pcpoc.rory.gay";
database_backend = "rocksdb";
enable_lightning_bolt = true;
max_concurrent_requests = 1000;
allow_check_for_updates = false;
allow_registration = false;
};
};
systemd.services.matrix-conduit-reg-token = {
enable = true;
description = "Random registration token for Conduit.";
wantedBy = [ "conduit.service" ]; # So the registration can be used by Conduit.
script = ''
reg_token=`cat /dev/urandom | tr -dc a-zA-Z0-9 | head -c 256`
mkdir -p /run/systemd/system/conduit.service.d
echo $reg_token > /run/conduit-registration-token
echo "[Service]" > /run/systemd/system/conduit.service.d/override.conf
echo Environment=\"CONDUIT_REGISTRATION_TOKEN=$reg_token\" >> /run/systemd/system/conduit.service.d/override.conf
systemctl daemon-reload
systemctl try-restart conduit.service'';
serviceConfig = {
User = "root";
Group = "root";
IgnoreSIGPIPE = true;
Restart = "on-failure";
};
};
}
|