Skip to content
Snippets Groups Projects
Commit 5cf1a606 authored by Jens Nolte's avatar Jens Nolte
Browse files

Move defaultSettings to recommendedSettings option

parent 3d0c3a2b
No related branches found
No related tags found
No related merge requests found
...@@ -54,18 +54,17 @@ in { ...@@ -54,18 +54,17 @@ in {
settings = mkOption { settings = mkOption {
type = settingsFormat.type; type = settingsFormat.type;
apply = recursiveUpdate cfg.defaultSettings;
default = {}; default = {};
description = '' description = ''
https://matrix-org.github.io/synapse/latest/usage/configuration/homeserver_sample_config.html https://matrix-org.github.io/synapse/latest/usage/configuration/homeserver_sample_config.html
''; '';
}; };
defaultSettings = mkOption { recommendedSettings = mkOption {
type = settingsFormat.type; type = types.bool;
default = import ./settings.nix inputs; default = false;
description = '' description = ''
Default settings (i.e. *my* settings). Can be overwritten by setting them to '{}'. Include recommended synapse settings, tuned for a small VPS instance with a few users (see 'recommended-settings.nix').
''; '';
}; };
...@@ -189,14 +188,13 @@ in { ...@@ -189,14 +188,13 @@ in {
assertion = !config.services.matrix-synapse.enable; assertion = !config.services.matrix-synapse.enable;
message = "Cannot use services.matrix-synapse and queezle.matrix-homeserver at the same time."; message = "Cannot use services.matrix-synapse and queezle.matrix-homeserver at the same time.";
} }
];
queezle.matrix-homeserver.settings = mkMerge [
(mkIf cfg.recommendedSettings (import ./recommended-settings.nix inputs))
{ {
assertion = config.queezle.matrix-homeserver.settings ? max_upload_size; server_name = cfg.serverName;
message = "queezle.matrix-homeserver.settings.max_upload_size not set";
} }
]; ];
queezle.matrix-homeserver.settings = {
server_name = cfg.serverName;
};
}; };
} }
...@@ -4,6 +4,7 @@ with lib; ...@@ -4,6 +4,7 @@ with lib;
let let
cfg = config.queezle.matrix-homeserver; cfg = config.queezle.matrix-homeserver;
in { in {
# TODO dedicated enable
config = mkIf cfg.enable { config = mkIf cfg.enable {
# postgresql database service # postgresql database service
services.postgresql = { services.postgresql = {
......
...@@ -16,9 +16,7 @@ in { ...@@ -16,9 +16,7 @@ in {
global_factor = 4.0; global_factor = 4.0;
}; };
# Set to default value because it needs to be configured on nginx # Generate thumbnails matching the resolution requested by clients
max_upload_size = "50M";
dynamic_thumbnails = true; dynamic_thumbnails = true;
url_preview_enabled = true; url_preview_enabled = true;
...@@ -44,14 +42,11 @@ in { ...@@ -44,14 +42,11 @@ in {
"fec0::/10" "fec0::/10"
]; ];
# TODO TURN
enable_registration = true; enable_registration = true;
registration_requires_token = true; registration_requires_token = true;
bcrypt_rounds = 14; # Benchmarked to take >0.5s on an AMD Ryzen 9 5900X bcrypt_rounds = 14; # Benchmarked to take >0.5s on an AMD Ryzen 9 5900X
# TODO Metrics # Report anonymized usage statistics
report_stats = false; report_stats = false;
trusted_key_servers = [ trusted_key_servers = [
...@@ -64,6 +59,4 @@ in { ...@@ -64,6 +59,4 @@ in {
minimum_length = 16; minimum_length = 16;
}; };
}; };
# TODO Push
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment