mirror of
https://github.com/gensokyo-zone/infrastructure.git
synced 2026-02-09 20:39:18 -08:00
28 lines
577 B
Nix
28 lines
577 B
Nix
{
|
|
config,
|
|
lib,
|
|
...
|
|
}: let
|
|
inherit (lib.options) mkOption;
|
|
inherit (lib.modules) mkOptionDefault;
|
|
cfg = config.services.keycloak;
|
|
in {
|
|
options.services.keycloak = with lib.types; {
|
|
protocol = mkOption {
|
|
type = enum ["http" "https"];
|
|
readOnly = true;
|
|
};
|
|
port = mkOption {
|
|
type = port;
|
|
readOnly = true;
|
|
};
|
|
};
|
|
config.services.keycloak = {
|
|
protocol = mkOptionDefault (
|
|
if cfg.sslCertificate != null
|
|
then "https"
|
|
else "http"
|
|
);
|
|
port = mkOptionDefault cfg.settings."${cfg.protocol}-port";
|
|
};
|
|
}
|