···2525 maintainers
2626 catAttrs
2727 collect
2828- splitString
2928 hasPrefix
3029 ;
3130···329328 };
330329331330 hostname = mkOption {
332332- type = str;
331331+ type = nullOr str;
332332+ default = null;
333333 example = "keycloak.example.com";
334334 description = lib.mdDoc ''
335335 The hostname part of the public URL used as base for
···451451452452 keycloakConfig = lib.generators.toKeyValue {
453453 mkKeyValue = lib.flip lib.generators.mkKeyValueDefault "=" {
454454- mkValueString = v: with builtins;
454454+ mkValueString = v:
455455 if isInt v then toString v
456456 else if isString v then v
457457 else if true == v then "true"
···479479 {
480480 assertion = createLocalPostgreSQL -> config.services.postgresql.settings.standard_conforming_strings or true;
481481 message = "Setting up a local PostgreSQL db for Keycloak requires `standard_conforming_strings` turned on to work reliably";
482482+ }
483483+ {
484484+ assertion = cfg.settings.hostname != null || cfg.settings.hostname-url or null != null;
485485+ message = "Setting the Keycloak hostname is required, see `services.keycloak.settings.hostname`";
486486+ }
487487+ {
488488+ assertion = !(cfg.settings.hostname != null && cfg.settings.hostname-url or null != null);
489489+ message = "`services.keycloak.settings.hostname` and `services.keycloak.settings.hostname-url` are mutually exclusive";
482490 }
483491 ];
484492