mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-22 23:13:19 +00:00
Merge pull request #267906 from talyz/keycloak-hostname-url
nixos/keycloak: Allow setting `hostname-url`
This commit is contained in:
commit
9ec830423e
@ -25,7 +25,6 @@ let
|
|||||||
maintainers
|
maintainers
|
||||||
catAttrs
|
catAttrs
|
||||||
collect
|
collect
|
||||||
splitString
|
|
||||||
hasPrefix
|
hasPrefix
|
||||||
;
|
;
|
||||||
|
|
||||||
@ -329,7 +328,8 @@ in
|
|||||||
};
|
};
|
||||||
|
|
||||||
hostname = mkOption {
|
hostname = mkOption {
|
||||||
type = str;
|
type = nullOr str;
|
||||||
|
default = null;
|
||||||
example = "keycloak.example.com";
|
example = "keycloak.example.com";
|
||||||
description = lib.mdDoc ''
|
description = lib.mdDoc ''
|
||||||
The hostname part of the public URL used as base for
|
The hostname part of the public URL used as base for
|
||||||
@ -451,7 +451,7 @@ in
|
|||||||
|
|
||||||
keycloakConfig = lib.generators.toKeyValue {
|
keycloakConfig = lib.generators.toKeyValue {
|
||||||
mkKeyValue = lib.flip lib.generators.mkKeyValueDefault "=" {
|
mkKeyValue = lib.flip lib.generators.mkKeyValueDefault "=" {
|
||||||
mkValueString = v: with builtins;
|
mkValueString = v:
|
||||||
if isInt v then toString v
|
if isInt v then toString v
|
||||||
else if isString v then v
|
else if isString v then v
|
||||||
else if true == v then "true"
|
else if true == v then "true"
|
||||||
@ -480,6 +480,14 @@ in
|
|||||||
assertion = createLocalPostgreSQL -> config.services.postgresql.settings.standard_conforming_strings or true;
|
assertion = createLocalPostgreSQL -> config.services.postgresql.settings.standard_conforming_strings or true;
|
||||||
message = "Setting up a local PostgreSQL db for Keycloak requires `standard_conforming_strings` turned on to work reliably";
|
message = "Setting up a local PostgreSQL db for Keycloak requires `standard_conforming_strings` turned on to work reliably";
|
||||||
}
|
}
|
||||||
|
{
|
||||||
|
assertion = cfg.settings.hostname != null || cfg.settings.hostname-url or null != null;
|
||||||
|
message = "Setting the Keycloak hostname is required, see `services.keycloak.settings.hostname`";
|
||||||
|
}
|
||||||
|
{
|
||||||
|
assertion = !(cfg.settings.hostname != null && cfg.settings.hostname-url or null != null);
|
||||||
|
message = "`services.keycloak.settings.hostname` and `services.keycloak.settings.hostname-url` are mutually exclusive";
|
||||||
|
}
|
||||||
];
|
];
|
||||||
|
|
||||||
environment.systemPackages = [ keycloakBuild ];
|
environment.systemPackages = [ keycloakBuild ];
|
||||||
|
Loading…
Reference in New Issue
Block a user