add valent
This commit is contained in:
parent
451ef9c46c
commit
461bbb1967
8 changed files with 105 additions and 3 deletions
22
clients/quadraticserver/matrix/bot.nix
Normal file
22
clients/quadraticserver/matrix/bot.nix
Normal file
|
@ -0,0 +1,22 @@
|
|||
{
|
||||
inputs,
|
||||
config,
|
||||
...
|
||||
}: {
|
||||
imports = [inputs.nexusbot.nixosModules.default];
|
||||
|
||||
services = let
|
||||
socket = "/var/run/nexusbot/socket";
|
||||
domain = "register.federated.nexus";
|
||||
in {
|
||||
nexusbot = {
|
||||
enable = true;
|
||||
botPasswordFile = config.age.secrets."botPassword.age".path;
|
||||
smtpPasswordFile = config.age.secrets."smtpPassword.age".path;
|
||||
args = ["--socket" socket "--homeserver" config.services.grapevine.settings.server_discovery.client.base_url "--name" "nexusbot" "--inviteTo" "#community:federated.nexus" "--adminRoom" "#admins:federated.nexus" "--successUri" "https://federated.nexus/success"];
|
||||
group = "caddy";
|
||||
};
|
||||
|
||||
caddy.virtualHosts."${domain}".extraConfig = "reverse_proxy unix/${socket}";
|
||||
};
|
||||
}
|
70
clients/quadraticserver/matrix/bridges.nix
Normal file
70
clients/quadraticserver/matrix/bridges.nix
Normal file
|
@ -0,0 +1,70 @@
|
|||
{
|
||||
pkgs,
|
||||
inputs,
|
||||
config,
|
||||
...
|
||||
}: let
|
||||
settings = {
|
||||
backfill.enabled = true;
|
||||
|
||||
appservice = {
|
||||
as_token = "$CUSTOM_AS_TOKEN";
|
||||
hs_token = "$CUSTOM_HS_TOKEN";
|
||||
};
|
||||
|
||||
homeserver = {
|
||||
domain = config.services.grapevine.settings.server_name;
|
||||
address = config.services.grapevine.settings.server_discovery.client.base_url;
|
||||
};
|
||||
|
||||
bridge = {
|
||||
encryption = {
|
||||
allow = true;
|
||||
default = true;
|
||||
require = false;
|
||||
};
|
||||
permissions = {
|
||||
"${config.services.grapevine.settings.server_name}" = "user";
|
||||
"@quadradical:${config.services.grapevine.settings.server_name}" = "admin";
|
||||
};
|
||||
};
|
||||
};
|
||||
in {
|
||||
imports = [inputs.nix-matrix-appservices.nixosModule inputs.ooye.modules.default];
|
||||
|
||||
services = let
|
||||
domain = "ooye.federated.nexus";
|
||||
in {
|
||||
matrix-appservices.services = builtins.mapAttrs (name: value:
|
||||
value
|
||||
// {
|
||||
inherit settings;
|
||||
format = "mautrix-go";
|
||||
port = 8000;
|
||||
package = value.package.override {withGoolm = true;};
|
||||
}) {
|
||||
whatsapp = {
|
||||
host = "127.0.0.4";
|
||||
serviceConfig.EnvironmentFile = config.age.secrets."whatsapp.age".path;
|
||||
package = pkgs.mautrix-whatsapp;
|
||||
};
|
||||
gmessages = {
|
||||
host = "127.0.0.5";
|
||||
serviceConfig.EnvironmentFile = config.age.secrets."gmessages.age".path;
|
||||
package = pkgs.mautrix-gmessages;
|
||||
};
|
||||
};
|
||||
|
||||
matrix-ooye = {
|
||||
enable = true;
|
||||
homeserver = config.services.grapevine.settings.server_discovery.client.base_url;
|
||||
homeserverName = "federated.nexus";
|
||||
discordTokenPath = config.age.secrets."discordToken.age".path;
|
||||
discordClientSecretPath = config.age.secrets."discordClientSecret.age".path;
|
||||
socket = "8081";
|
||||
bridgeOrigin = "https://${domain}";
|
||||
};
|
||||
|
||||
caddy.virtualHosts."${domain}".extraConfig = "reverse_proxy 127.0.0.1:${config.services.matrix-ooye.socket}";
|
||||
};
|
||||
}
|
37
clients/quadraticserver/matrix/grapevine.nix
Normal file
37
clients/quadraticserver/matrix/grapevine.nix
Normal file
|
@ -0,0 +1,37 @@
|
|||
{inputs, ...}: {
|
||||
imports = [inputs.grapevine.nixosModules.default];
|
||||
networking.firewall.allowedTCPPorts = [8448];
|
||||
|
||||
services = let
|
||||
domain = "federated.nexus";
|
||||
subdomain = "matrix.${domain}";
|
||||
address = "127.0.0.3";
|
||||
in {
|
||||
grapevine = {
|
||||
enable = true;
|
||||
settings = {
|
||||
server_name = domain;
|
||||
database.backend = "rocksdb";
|
||||
media.allow_unauthenticated_access = true;
|
||||
federation = {
|
||||
max_concurrent_requests = 10000;
|
||||
self_test = false;
|
||||
};
|
||||
|
||||
server_discovery = {
|
||||
server.authority = "${subdomain}:443";
|
||||
client.base_url = "https://${subdomain}";
|
||||
};
|
||||
|
||||
listen = [
|
||||
{
|
||||
type = "tcp";
|
||||
inherit address;
|
||||
}
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
caddy.virtualHosts."${subdomain}".extraConfig = "reverse_proxy ${address}:6167";
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue