format
This commit is contained in:
parent
7fc3164ab8
commit
a8b581f499
12 changed files with 81 additions and 64 deletions
|
|
@ -1,5 +1,9 @@
|
|||
{pkgs, config, lib, ...}:
|
||||
let
|
||||
{
|
||||
pkgs,
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}: let
|
||||
fqdn = "${hostname}.${domain}";
|
||||
domain = "tristans.cloud";
|
||||
hostname = "matrix";
|
||||
|
|
@ -12,7 +16,6 @@ let
|
|||
inherit (config) sops;
|
||||
inherit (config.services) matrix-synapse;
|
||||
inherit (sops) secrets templates;
|
||||
|
||||
in {
|
||||
services.postgresql.enable = true;
|
||||
services.postgresql.initialScript = pkgs.writeText "synapse-init.sql" ''
|
||||
|
|
@ -32,21 +35,23 @@ in {
|
|||
"synapse/secrets.yaml" = {
|
||||
owner = "matrix-synapse";
|
||||
content = builtins.toJSON {
|
||||
oidc_providers = [{
|
||||
idp_id = "authentik";
|
||||
idp_name = "authentik";
|
||||
discover = true;
|
||||
issuer = "https://auth.tristans.cloud/application/o/chat/";
|
||||
client_id = "fdad520e8c57f228aaa658aa74d5e00ba9b164a3";
|
||||
client_secret = sops.placeholder."synapse/oidc_client_secret";
|
||||
scopes = ["openid" "profile" "email"];
|
||||
user_mapping_provider = {
|
||||
config = {
|
||||
localpart_template= "{{ user.preferred_username }}";
|
||||
display_name_template= "{{ user.name|capitalize }}";
|
||||
oidc_providers = [
|
||||
{
|
||||
idp_id = "authentik";
|
||||
idp_name = "authentik";
|
||||
discover = true;
|
||||
issuer = "https://auth.tristans.cloud/application/o/chat/";
|
||||
client_id = "fdad520e8c57f228aaa658aa74d5e00ba9b164a3";
|
||||
client_secret = sops.placeholder."synapse/oidc_client_secret";
|
||||
scopes = ["openid" "profile" "email"];
|
||||
user_mapping_provider = {
|
||||
config = {
|
||||
localpart_template = "{{ user.preferred_username }}";
|
||||
display_name_template = "{{ user.name|capitalize }}";
|
||||
};
|
||||
};
|
||||
};
|
||||
}];
|
||||
}
|
||||
];
|
||||
};
|
||||
};
|
||||
"synapse/sliding_sync_env".content = ''
|
||||
|
|
@ -62,17 +67,21 @@ in {
|
|||
server_name = domain;
|
||||
baseurl = "https://${domain}";
|
||||
oidc_providers = [];
|
||||
settings.listeners = [ {
|
||||
inherit port;
|
||||
bind_addresses = [ "localhost" ];
|
||||
type = "http";
|
||||
tls = false;
|
||||
x_forwarded = true;
|
||||
resources = [ {
|
||||
names = [ "client" "federation" ];
|
||||
compress = true;
|
||||
} ];
|
||||
} ];
|
||||
settings.listeners = [
|
||||
{
|
||||
inherit port;
|
||||
bind_addresses = ["localhost"];
|
||||
type = "http";
|
||||
tls = false;
|
||||
x_forwarded = true;
|
||||
resources = [
|
||||
{
|
||||
names = ["client" "federation"];
|
||||
compress = true;
|
||||
}
|
||||
];
|
||||
}
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue