mirror of
https://github.com/gensokyo-zone/infrastructure.git
synced 2026-02-10 04:49:19 -08:00
20 lines
547 B
Nix
20 lines
547 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";
|
|
};
|
|
}
|