refactor(#2015): drop redundant domain != null checks (domain is required) + update docs
This commit is contained in:
parent
816d387c65
commit
c8ae3371e1
6 changed files with 88 additions and 130 deletions
|
|
@ -149,13 +149,8 @@ in
|
|||
|
||||
gatewayHost = lib.mkOption {
|
||||
type = lib.types.nullOr lib.types.str;
|
||||
default = if hyperhiveDomain != null then "matrix.${hyperhiveDomain}" else null;
|
||||
defaultText = lib.literalExpression ''
|
||||
if services.hyperhive.domain != null then
|
||||
"matrix.''${services.hyperhive.domain}"
|
||||
else
|
||||
null
|
||||
'';
|
||||
default = "matrix.${hyperhiveDomain}";
|
||||
defaultText = lib.literalExpression ''"matrix.''${services.hyperhive.domain}"'';
|
||||
example = "matrix.example.com";
|
||||
description = ''
|
||||
Public hostname for the matrix homeserver behind the gateway.
|
||||
|
|
@ -294,25 +289,13 @@ in
|
|||
};
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
# serverName must exist (irrevocably embedded in user/room IDs);
|
||||
# gatewayHost may not be "" (same footgun as forge.domain —
|
||||
# nginx rejects an empty server_name). docs/matrix.md::Assertion
|
||||
# rationale.
|
||||
# `serverName` is irrevocably embedded in user/room IDs; it derives
|
||||
# from `services.hyperhive.domain` (required, asserted in
|
||||
# hive-network.nix) when not set explicitly, so no separate
|
||||
# domain/serverName assertion is needed here. gatewayHost may not be
|
||||
# "" (same footgun as forge.domain — nginx rejects an empty
|
||||
# server_name). docs/matrix.md::Assertion rationale.
|
||||
assertions = [
|
||||
{
|
||||
assertion = hyperhiveDomain != null || cfg.serverName != null;
|
||||
message = ''
|
||||
services.hyperhive.matrix.enable = true requires either:
|
||||
- services.hyperhive.domain set to your host's canonical domain
|
||||
(recommended; shared with forge / dashboard), or
|
||||
- services.hyperhive.matrix.serverName set explicitly.
|
||||
|
||||
The matrix server_name is embedded into every user ID and
|
||||
room ID on this homeserver — it cannot be changed later
|
||||
without losing every account and chat history. Pick a
|
||||
stable hostname before enabling.
|
||||
'';
|
||||
}
|
||||
{
|
||||
assertion = cfg.gatewayHost == null || cfg.gatewayHost != "";
|
||||
message = ''
|
||||
|
|
|
|||
Loading…
Reference in a new issue