2025-09-06 15:30:37 +00:00
|
|
|
{ config, common, ... }:
|
|
|
|
let
|
|
|
|
port = 8086;
|
|
|
|
domain = "beta.auth.${common.domain}";
|
|
|
|
dbPassKey = "keycloak/database-pass";
|
|
|
|
in
|
|
|
|
{
|
2025-09-23 16:08:50 +00:00
|
|
|
|
2025-09-06 15:30:37 +00:00
|
|
|
services = {
|
|
|
|
keycloak = {
|
|
|
|
enable = true;
|
|
|
|
settings = {
|
2025-09-23 16:08:50 +00:00
|
|
|
hostname = "https://${domain}";
|
2025-09-06 15:30:37 +00:00
|
|
|
http-port = port;
|
|
|
|
http-enabled = true;
|
|
|
|
};
|
|
|
|
database = {
|
|
|
|
type = "postgresql";
|
2025-09-23 16:08:50 +00:00
|
|
|
createLocally = true;
|
2025-09-06 15:30:37 +00:00
|
|
|
port = config.services.postgresql.settings.port;
|
|
|
|
passwordFile = config.sops.secrets.${dbPassKey}.path;
|
|
|
|
};
|
2025-09-23 16:08:50 +00:00
|
|
|
initialAdminPassword = "changeme";
|
2025-09-06 15:30:37 +00:00
|
|
|
};
|
|
|
|
|
2025-09-23 16:08:50 +00:00
|
|
|
nginx.virtualHosts.${domain} = {
|
2025-09-06 15:30:37 +00:00
|
|
|
forceSSL = true;
|
|
|
|
enableACME = true;
|
2025-09-23 16:08:50 +00:00
|
|
|
locations."/".proxyPass = "http://localhost:${toString port}";
|
2025-09-06 15:30:37 +00:00
|
|
|
};
|
|
|
|
};
|
|
|
|
sops.secrets.${dbPassKey} = { };
|
|
|
|
}
|