2024-08-15 14:22:22 +00:00
|
|
|
{
|
|
|
|
config,
|
|
|
|
lib,
|
|
|
|
inputs,
|
|
|
|
...
|
|
|
|
}:
|
|
|
|
|
|
|
|
let
|
|
|
|
cfg = config.bagel.services.grapevine;
|
|
|
|
inherit (lib) mkEnableOption mkIf;
|
|
|
|
in
|
|
|
|
|
2024-08-09 13:58:46 +00:00
|
|
|
{
|
|
|
|
imports = [
|
2024-08-15 14:22:22 +00:00
|
|
|
inputs.grapevine.nixosModules.default
|
2024-08-09 13:58:46 +00:00
|
|
|
./hookshot.nix
|
|
|
|
];
|
2024-08-15 14:22:22 +00:00
|
|
|
|
|
|
|
options.bagel.services.grapevine.enable = mkEnableOption "Grapevine";
|
|
|
|
|
|
|
|
config = mkIf cfg.enable {
|
|
|
|
services = {
|
|
|
|
grapevine = {
|
|
|
|
enable = true;
|
|
|
|
settings = {
|
|
|
|
listen = [
|
|
|
|
{
|
|
|
|
type = "tcp";
|
|
|
|
address = "127.0.0.1";
|
|
|
|
port = 6167;
|
|
|
|
}
|
|
|
|
];
|
|
|
|
server_name = "forkos.org";
|
|
|
|
database.backend = "rocksdb";
|
2024-10-21 13:31:26 +00:00
|
|
|
|
|
|
|
server_discovery = {
|
|
|
|
server.authority = "matrix.forkos.org:443";
|
|
|
|
client.base_url = "https://matrix.forkos.org";
|
|
|
|
};
|
2024-08-15 14:22:22 +00:00
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
nginx = {
|
|
|
|
upstreams.grapevine.servers."127.0.0.1:6167" = { };
|
|
|
|
|
|
|
|
virtualHosts = {
|
|
|
|
"matrix.forkos.org" = {
|
|
|
|
forceSSL = true;
|
|
|
|
enableACME = true;
|
|
|
|
locations."/".proxyPass = "http://grapevine";
|
|
|
|
};
|
|
|
|
|
|
|
|
"forkos.org" = {
|
|
|
|
forceSSL = true;
|
|
|
|
enableACME = true;
|
2024-10-21 13:31:26 +00:00
|
|
|
locations."/.well-known/matrix".proxyPass = "http://grapevine";
|
2024-08-15 14:22:22 +00:00
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
2024-08-09 13:58:46 +00:00
|
|
|
}
|