{ config, lib, ... }: with lib; let cfg = config.local.conduit; inherit (config.local.domains.matrix.passthru) serverName; in { options.local.conduit = { enable = mkEnableOption "conduit Matrix homeserver"; listenAddress = mkOption { type = types.str; default = "127.0.0.1"; }; listenPort = mkOption { type = types.port; default = 6167; }; }; config = mkIf cfg.enable { services.matrix-conduit = { enable = true; settings.global = { port = cfg.listenPort; address = cfg.listenAddress; server_name = serverName; database_backend = "sqlite"; allow_encryption = true; allow_federation = true; allow_registration = false; }; }; }; }