Skip to content

Commit

Permalink
refactor(element): move from docker to nixos package
Browse files Browse the repository at this point in the history
  • Loading branch information
diogotcorreia committed Dec 31, 2024
1 parent c3eb331 commit 2fdadec
Showing 1 changed file with 55 additions and 6 deletions.
61 changes: 55 additions & 6 deletions hosts/hera/conduit.nix
Original file line number Diff line number Diff line change
@@ -1,9 +1,55 @@
# Configuration for Conduit (Matrix Homeserver) on Hera
{config, ...}: let
{
config,
pkgs,
...
}: let
domainConduit = "m.diogotc.com";
portConduit = 6167;
domainElement = "chat.diogotc.com";
portElement = 8012;

# https://web-docs.element.dev/Element%20Web/config.html
elementConfig = {
default_server_name = "diogotc.com";
disable_custom_urls = true;
disable_guests = true;
disable_login_language_selector = false;
disable_3pid = true;
brand = "DTC Element";

integrations_ui_url = "https://scalar.vector.im/";
integrations_rest_url = "https://scalar.vector.im/api";
integrations_widgets_urls = [
"https://scalar.vector.im/_matrix/integrations/v1"
"https://scalar.vector.im/api"
"https://scalar-staging.vector.im/_matrix/integrations/v1"
"https://scalar-staging.vector.im/api"
"https://scalar-staging.riot.im/scalar/api"
];
integrations_jitsi_widget_url = "https://scalar.vector.im/api/widgets/jitsi.html";

default_country_code = "PT";

show_labs_settings = true;
features = {};
default_federate = true;
default_theme = "dark";
room_directory = {
servers = ["diogotc.com"];
};
setting_defaults = {
breadcrumbs = true;
};
jitsi = {
preferred_domain = "meet.element.io";
};
element_call = {
url = "https://call.element.io";
participant_limit = 8;
brand = "Element Call";
};
map_style_url = "https://api.maptiler.com/maps/streets/style.json?key=fU3vlMsMn4Jb6dnEIFsx";
};
in {
# TODO move docker containers to NixOS services

Expand All @@ -23,12 +69,15 @@ in {
}
'';
};
${domainElement} = {
${domainElement} = let
elementPkg = pkgs.element-web.override {
conf = elementConfig;
};
in {
enableACME = true;
extraConfig = ''
reverse_proxy localhost:${toString portElement} {
import CLOUDFLARE_PROXY
}
root ${elementPkg}
file_server
'';
};
};
Expand Down

0 comments on commit 2fdadec

Please sign in to comment.