···25 maintainers
26 catAttrs
27 collect
28- splitString
29 hasPrefix
30 ;
31···329 };
330331 hostname = mkOption {
332- type = str;
0333 example = "keycloak.example.com";
334 description = lib.mdDoc ''
335 The hostname part of the public URL used as base for
···451452 keycloakConfig = lib.generators.toKeyValue {
453 mkKeyValue = lib.flip lib.generators.mkKeyValueDefault "=" {
454- mkValueString = v: with builtins;
455 if isInt v then toString v
456 else if isString v then v
457 else if true == v then "true"
···479 {
480 assertion = createLocalPostgreSQL -> config.services.postgresql.settings.standard_conforming_strings or true;
481 message = "Setting up a local PostgreSQL db for Keycloak requires `standard_conforming_strings` turned on to work reliably";
00000000482 }
483 ];
484
···25 maintainers
26 catAttrs
27 collect
028 hasPrefix
29 ;
30···328 };
329330 hostname = mkOption {
331+ type = nullOr str;
332+ default = null;
333 example = "keycloak.example.com";
334 description = lib.mdDoc ''
335 The hostname part of the public URL used as base for
···451452 keycloakConfig = lib.generators.toKeyValue {
453 mkKeyValue = lib.flip lib.generators.mkKeyValueDefault "=" {
454+ mkValueString = v:
455 if isInt v then toString v
456 else if isString v then v
457 else if true == v then "true"
···479 {
480 assertion = createLocalPostgreSQL -> config.services.postgresql.settings.standard_conforming_strings or true;
481 message = "Setting up a local PostgreSQL db for Keycloak requires `standard_conforming_strings` turned on to work reliably";
482+ }
483+ {
484+ assertion = cfg.settings.hostname != null || cfg.settings.hostname-url or null != null;
485+ message = "Setting the Keycloak hostname is required, see `services.keycloak.settings.hostname`";
486+ }
487+ {
488+ assertion = !(cfg.settings.hostname != null && cfg.settings.hostname-url or null != null);
489+ message = "`services.keycloak.settings.hostname` and `services.keycloak.settings.hostname-url` are mutually exclusive";
490 }
491 ];
492