git.iko.soy/typeable/nixpkgs
on master help sign in
Merge pull request #19115 from Ralith/matrix-synapse

matrix-synapse: 0.17.1 -> 0.18.0

commitf2f7420e2b0d1b149bc9d3177ab77f840c058d07 authorJörg Thalheim <joerg@higgsboson.tk> dateSat 1 Oct 2016, 14:54 (10 years ago) parent505f8e10b4f8b9
1 file changed+45−10
nixos/modules/services/misc/matrix-synapse.nix+45−10
nixos/modules/services/misc/matrix-synapse.nix+45−10
@@ -5,15 +5,16 @@ with lib;
55let
66 cfg = config.services.matrix-synapse;
77 logConfigFile = pkgs.writeText "log_config.yaml" cfg.logConfig;
8− mkResource = r: ''{names: ${builtins.toJSON r.names}, compress: ${if r.compress then "true" else "false"}}'';
9− mkListener = l: ''{port: ${toString l.port}, bind_address: "${l.bind_address}", type: ${l.type}, tls: ${if l.tls then "true" else "false"}, x_forwarded: ${if l.x_forwarded then "true" else "false"}, resources: [${concatStringsSep "," (map mkResource l.resources)}]}'';
8+ mkResource = r: ''{names: ${builtins.toJSON r.names}, compress: ${fromBool r.compress}}'';
9+ mkListener = l: ''{port: ${toString l.port}, bind_address: "${l.bind_address}", type: ${l.type}, tls: ${fromBool l.tls}, x_forwarded: ${fromBool l.x_forwarded}, resources: [${concatStringsSep "," (map mkResource l.resources)}]}'';
10+ fromBool = x: if x then "true" else "false";
1011 configFile = pkgs.writeText "homeserver.yaml" ''
1112tls_certificate_path: "${cfg.tls_certificate_path}"
1213${optionalString (cfg.tls_private_key_path != null) ''
1314tls_private_key_path: "${cfg.tls_private_key_path}"
1415''}
1516tls_dh_params_path: "${cfg.tls_dh_params_path}"
16−no_tls: ${if cfg.no_tls then "true" else "false"}
17+no_tls: ${fromBool cfg.no_tls}
1718${optionalString (cfg.bind_port != null) ''
1819bind_port: ${toString cfg.bind_port}
1920''}
@@ -25,7 +26,7 @@ bind_host: "${cfg.bind_host}"
2526''}
2627server_name: "${cfg.server_name}"
2728pid_file: "/var/run/matrix-synapse.pid"
28−web_client: ${if cfg.web_client then "true" else "false"}
29+web_client: ${fromBool cfg.web_client}
2930${optionalString (cfg.public_baseurl != null) ''
3031public_baseurl: "${cfg.public_baseurl}"
3132''}
@@ -53,14 +54,14 @@ media_store_path: "/var/lib/matrix-synapse/media"
5354uploads_path: "/var/lib/matrix-synapse/uploads"
5455max_upload_size: "${cfg.max_upload_size}"
5556max_image_pixels: "${cfg.max_image_pixels}"
56−dynamic_thumbnails: ${if cfg.dynamic_thumbnails then "true" else "false"}
57+dynamic_thumbnails: ${fromBool cfg.dynamic_thumbnails}
5758url_preview_enabled: False
5859recaptcha_private_key: "${cfg.recaptcha_private_key}"
5960recaptcha_public_key: "${cfg.recaptcha_public_key}"
60−enable_registration_captcha: ${if cfg.enable_registration_captcha then "true" else "false"}
61+enable_registration_captcha: ${fromBool cfg.enable_registration_captcha}
6162turn_uris: ${builtins.toJSON cfg.turn_uris}
6263turn_shared_secret: "${cfg.turn_shared_secret}"
63−enable_registration: ${if cfg.enable_registration then "true" else "false"}
64+enable_registration: ${fromBool cfg.enable_registration}
6465${optionalString (cfg.registration_shared_secret != null) ''
6566registration_shared_secret: "${cfg.registration_shared_secret}"
6667''}
@@ -68,9 +69,15 @@ recaptcha_siteverify_api: "https://www.google.com/recaptcha/api/siteverify"
6869turn_user_lifetime: "${cfg.turn_user_lifetime}"
6970user_creation_max_duration: ${cfg.user_creation_max_duration}
7071bcrypt_rounds: ${cfg.bcrypt_rounds}
71−allow_guest_access: {if cfg.allow_guest_access then "true" else "false"}
72−enable_metrics: ${if cfg.enable_metrics then "true" else "false"}
73−report_stats: ${if cfg.report_stats then "true" else "false"}
72+allow_guest_access: ${fromBool cfg.allow_guest_access}
73+trusted_third_party_id_servers: ${builtins.toJSON cfg.trusted_third_party_id_servers}
74+room_invite_state_types: ${builtins.toJSON cfg.room_invite_state_types}
75+${optionalString (cfg.macaroon_secret_key != null) ''
76+ macaroon_secret_key: "${cfg.macaroon_secret_key}"
77+''}
78+expire_access_token: ${fromBool cfg.expire_access_token}
79+enable_metrics: ${fromBool cfg.enable_metrics}
80+report_stats: ${fromBool cfg.report_stats}
7481signing_key_path: "/var/lib/matrix-synapse/homeserver.signing.key"
7582key_refresh_interval: "${cfg.key_refresh_interval}"
7683perspectives:
@@ -469,6 +476,34 @@ in {
469476 accessible to anonymous users.
470477 '';
471478 };
479+ trusted_third_party_id_servers = mkOption {
480+ type = types.listOf types.str;
481+ default = ["matrix.org"];
482+ description = ''
483+ The list of identity servers trusted to verify third party identifiers by this server.
484+ '';
485+ };
486+ room_invite_state_types = mkOption {
487+ type = types.listOf types.str;
488+ default = ["m.room.join_rules" "m.room.canonical_alias" "m.room.avatar" "m.room.name"];
489+ description = ''
490+ A list of event types that will be included in the room_invite_state
491+ '';
492+ };
493+ macaroon_secret_key = mkOption {
494+ type = types.nullOr types.str;
495+ default = null;
496+ description = ''
497+ Secret key for authentication tokens
498+ '';
499+ };
500+ expire_access_token = mkOption {
501+ type = types.bool;
502+ default = false;
503+ description = ''
504+ Whether to enable access token expiration.
505+ '';
506+ };
472507 key_refresh_interval = mkOption {
473508 type = types.str;
474509 default = "1d";