diff --git a/machines/hippocampus/servers/public/matrix/bots/discord.nix b/machines/hippocampus/servers/public/matrix/bots/discord.nix index 7bf7010..a5f23b7 100644 --- a/machines/hippocampus/servers/public/matrix/bots/discord.nix +++ b/machines/hippocampus/servers/public/matrix/bots/discord.nix @@ -337,88 +337,88 @@ in { # You should not enable this option unless you understand all the implications. disable_device_change_key_rotation = false; }; + }; - # Settings for provisioning API - provisioning = { - # Prefix for the provisioning API paths. - prefix = "/_matrix/provision"; - # Shared secret for authentication. If set to "generate", a random secret will be generated, - # or if set to "disable", the provisioning API will be disabled. - shared_secret = "generate"; - # Enable debug API at /debug with provisioning authentication. - debug_endpoints = false; - }; + # Settings for provisioning API + provisioning = { + # Prefix for the provisioning API paths. + prefix = "/_matrix/provision"; + # Shared secret for authentication. If set to "generate", a random secret will be generated, + # or if set to "disable", the provisioning API will be disabled. + shared_secret = "generate"; + # Enable debug API at /debug with provisioning authentication. + debug_endpoints = false; + }; - # Permissions for using the bridge. - # Permitted values: - # relay - Talk through the relaybot (if enabled), no access otherwise - # user - Access to use the bridge to chat with a Discord account. - # admin - User level and some additional administration tools - # Permitted keys: - # * - All Matrix users - # domain - All users on that homeserver - # mxid - Specific user - permissions = { - "*" = "relay"; - "glia.club" = "user"; - "@admin:glia.club" = "admin"; - "@cyborgpotato:glia.club" = "admin"; - }; + # Permissions for using the bridge. + # Permitted values: + # relay - Talk through the relaybot (if enabled), no access otherwise + # user - Access to use the bridge to chat with a Discord account. + # admin - User level and some additional administration tools + # Permitted keys: + # * - All Matrix users + # domain - All users on that homeserver + # mxid - Specific user + permissions = { + "*" = "relay"; + "glia.club" = "user"; + "@admin:glia.club" = "admin"; + "@cyborgpotato:glia.club" = "admin"; }; }; - appservice = { - # The address that the homeserver can use to connect to this appservice. - address = "http://localhost:${toString config.services.mautrix-discord.settings.appservice.port}"; + }; + appservice = { + # The address that the homeserver can use to connect to this appservice. + address = "http://localhost:${toString config.services.mautrix-discord.settings.appservice.port}"; - # The hostname and port where this appservice should listen. - hostname = "0.0.0.0"; - port = 7193; + # The hostname and port where this appservice should listen. + hostname = "0.0.0.0"; + port = 7193; - # Database config. - # See definition at top of file - database = { - # The database type. "sqlite3-fk-wal" and "postgres" are supported. - type = "postgres"; - # The database URI. - # SQLite: A raw file path is supported, but `file:?_txlock=immediate` is recommended. - # https://github.com/mattn/go-sqlite3#connection-string - # Postgres: Connection string. For example, postgres://user:password@host/database?sslmode=disable - # To connect via Unix socket, use something like postgres:///dbname?host=/var/run/postgresql - uri = "postgres:///${mautrix-discord-user}?host=/var/run/postgresql"; - # Maximum number of connections. Mostly relevant for Postgres. - max_open_conns = 20; - max_idle_conns = 2; - # Maximum connection idle time and lifetime before they're closed. Disabled if null. - # Parsed with https://pkg.go.dev/time#ParseDuration - max_conn_idle_time = null; - max_conn_lifetime = null; - }; - - # The unique ID of this appservice. - id = "discord"; - # Appservice bot details. - bot = { - # Username of the appservice bot. - username = "discordbot"; - # Display name and avatar for bot. Set to "remove" to remove display name/avatar, leave empty - # to leave display name/avatar as-is. - displayname = "Discord bridge bot"; - avatar = "mxc://maunium.net/nIdEykemnwdisvHbpxflpDlC"; - }; - - # Whether or not to receive ephemeral events via appservice transactions. - # Requires MSC2409 support (i.e. Synapse 1.22+). - ephemeral_events = true; - - # Should incoming events be handled asynchronously? - # This may be necessary for large public instances with lots of messages going through. - # However, messages will not be guaranteed to be bridged in the same order they were sent in. - async_transactions = false; - - # Authentication tokens for AS <-> HS communication. Autogenerated; do not modify. - as_token = "$MAUTRIX_DISCORD_APPSERVICE_AS_TOKEN"; - hs_token = "$MAUTRIX_DISCORD_APPSERVICE_HS_TOKEN"; + # Database config. + # See definition at top of file + database = { + # The database type. "sqlite3-fk-wal" and "postgres" are supported. + type = "postgres"; + # The database URI. + # SQLite: A raw file path is supported, but `file:?_txlock=immediate` is recommended. + # https://github.com/mattn/go-sqlite3#connection-string + # Postgres: Connection string. For example, postgres://user:password@host/database?sslmode=disable + # To connect via Unix socket, use something like postgres:///dbname?host=/var/run/postgresql + uri = "postgres:///${mautrix-discord-user}?host=/var/run/postgresql"; + # Maximum number of connections. Mostly relevant for Postgres. + max_open_conns = 20; + max_idle_conns = 2; + # Maximum connection idle time and lifetime before they're closed. Disabled if null. + # Parsed with https://pkg.go.dev/time#ParseDuration + max_conn_idle_time = null; + max_conn_lifetime = null; }; + + # The unique ID of this appservice. + id = "discord"; + # Appservice bot details. + bot = { + # Username of the appservice bot. + username = "discordbot"; + # Display name and avatar for bot. Set to "remove" to remove display name/avatar, leave empty + # to leave display name/avatar as-is. + displayname = "Discord bridge bot"; + avatar = "mxc://maunium.net/nIdEykemnwdisvHbpxflpDlC"; + }; + + # Whether or not to receive ephemeral events via appservice transactions. + # Requires MSC2409 support (i.e. Synapse 1.22+). + ephemeral_events = true; + + # Should incoming events be handled asynchronously? + # This may be necessary for large public instances with lots of messages going through. + # However, messages will not be guaranteed to be bridged in the same order they were sent in. + async_transactions = false; + + # Authentication tokens for AS <-> HS communication. Autogenerated; do not modify. + as_token = "$MAUTRIX_DISCORD_APPSERVICE_AS_TOKEN"; + hs_token = "$MAUTRIX_DISCORD_APPSERVICE_HS_TOKEN"; }; serviceDependencies = [ config.services.mautrix-discord.registrationServiceUnit ] ++ (lib.lists.optional config.services.matrix-synapse.enable config.services.matrix-synapse.serviceUnit)