mirror of
https://git.sr.ht/~magic_rb/dotfiles
synced 2024-11-25 01:26:14 +01:00
Update synapse container
Signed-off-by: magic_rb <richard@brezak.sk>
This commit is contained in:
parent
66bc26a113
commit
8109dc3abc
|
@ -1112,11 +1112,11 @@
|
||||||
"nixpkgs": "nixpkgs_8"
|
"nixpkgs": "nixpkgs_8"
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1689967002,
|
"lastModified": 1696701494,
|
||||||
"narHash": "sha256-CYpbDmABaiRtH7MtIjBKAJ2H2MDqZU8Mur3Qkgj6J3w=",
|
"narHash": "sha256-8R+nrspQZ0mMiOk66bDjlVrEZsYwb6siDIR41oFuUTs=",
|
||||||
"owner": "nix-community",
|
"owner": "nix-community",
|
||||||
"repo": "NixNG",
|
"repo": "NixNG",
|
||||||
"rev": "3cba1cfa9cfd8051333d45a60cc180907461a2dd",
|
"rev": "c12525e008a489cf5a41447242d4a51ee7eab461",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
|
|
@ -18,6 +18,7 @@ makeSystem {
|
||||||
};
|
};
|
||||||
|
|
||||||
services.synapse.workers.${name} = {
|
services.synapse.workers.${name} = {
|
||||||
|
package = import ./synapse-package.nix pkgs;
|
||||||
settings = {
|
settings = {
|
||||||
worker_app = "synapse.app.generic_worker";
|
worker_app = "synapse.app.generic_worker";
|
||||||
|
|
||||||
|
|
10
nixng/containers/matrix/synapse/synapse-package.nix
Normal file
10
nixng/containers/matrix/synapse/synapse-package.nix
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
pkgs:
|
||||||
|
pkgs.matrix-synapse.override {
|
||||||
|
extras = [
|
||||||
|
"redis"
|
||||||
|
"cache-memory"
|
||||||
|
"postgres"
|
||||||
|
"url-preview"
|
||||||
|
"user-search"
|
||||||
|
];
|
||||||
|
}
|
|
@ -11,7 +11,8 @@ makeSystem {
|
||||||
{ pkgs, lib, ... }:
|
{ pkgs, lib, ... }:
|
||||||
let
|
let
|
||||||
inherit (lib)
|
inherit (lib)
|
||||||
singleton;
|
singleton
|
||||||
|
makeSearchPathOutput;
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
dumb-init = {
|
dumb-init = {
|
||||||
|
@ -19,54 +20,49 @@ makeSystem {
|
||||||
type.services = { };
|
type.services = { };
|
||||||
};
|
};
|
||||||
|
|
||||||
init.services.synapse = {
|
services.synapse = {
|
||||||
enabled = true;
|
enable = true;
|
||||||
shutdownOnExit = true;
|
package = import ./synapse-package.nix pkgs;
|
||||||
script =
|
settings = {
|
||||||
let
|
listeners =
|
||||||
synapseConfig = (pkgs.formats.yaml {}).generate "synapse.yaml"
|
[
|
||||||
|
# The HTTP replication port
|
||||||
{
|
{
|
||||||
listeners =
|
port = 9093;
|
||||||
[
|
bind_addresses = [ "0.0.0.0" ];
|
||||||
# The HTTP replication port
|
type = "http";
|
||||||
{
|
resources = [
|
||||||
port = 9093;
|
{
|
||||||
bind_addresses = [ "0.0.0.0" ];
|
names = [ "replication" ];
|
||||||
type = "http";
|
}
|
||||||
resources = [
|
];
|
||||||
{
|
}
|
||||||
names = [ "replication" ];
|
{
|
||||||
}
|
port = 6167;
|
||||||
];
|
tls = false;
|
||||||
}
|
type = "http";
|
||||||
{
|
x_forwarded = true;
|
||||||
port = 6167;
|
bind_adrresses = [ "0.0.0.0" ];
|
||||||
tls = false;
|
resources = singleton {
|
||||||
type = "http";
|
names = [ "client" "federation" ];
|
||||||
x_forwarded = true;
|
compress = false;
|
||||||
bind_adrresses = [ "0.0.0.0" ];
|
};
|
||||||
resources = singleton {
|
}
|
||||||
names = [ "client" "federation" ];
|
];
|
||||||
compress = false;
|
|
||||||
};
|
|
||||||
}
|
|
||||||
];
|
|
||||||
|
|
||||||
public_baseurl = "https://matrix.redalder.org/";
|
public_baseurl = "https://matrix.redalder.org/";
|
||||||
|
|
||||||
# Add a random shared secret to authenticate traffic.
|
# Add a random shared secret to authenticate traffic.
|
||||||
worker_replication_secret = "";
|
worker_replication_secret = "";
|
||||||
};
|
};
|
||||||
in
|
arguments = {
|
||||||
pkgs.writeShellScript "synapse" ''
|
"config-path" = [
|
||||||
${pkgs.matrix-synapse}/bin/synapse_homeserver \
|
(commonConfig pkgs)
|
||||||
--config-path ${synapseConfig} \
|
"/secrets/extra.yaml"
|
||||||
--config-path ${commonConfig pkgs} \
|
"/var/lib/registrations/extra.yaml"
|
||||||
--config-path /secrets/extra.yaml \
|
];
|
||||||
--config-path /var/lib/registrations/extra.yaml \
|
"keys-directory" = "/var/lib/synapse/keys";
|
||||||
--keys-directory /var/lib/synapse/keys \
|
};
|
||||||
$([ -e /var/lib/synapse/signing.key ] || echo --generate-keys)
|
|
||||||
'';
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue