1
0
Fork 0
selfhostblocks/tests/integration/keycloak/services.nix

48 lines
1.3 KiB
Nix
Raw Normal View History

2023-02-23 08:04:44 +01:00
{ system, pkgs, distribution, invDistribution }:
let
utils = pkgs.lib.callPackageWith pkgs ../../../utils.nix { };
2023-03-07 09:21:20 +01:00
customPkgs = import ../../../all-packages.nix {
2023-02-23 08:04:44 +01:00
inherit system pkgs utils;
};
in
2023-03-07 09:21:20 +01:00
with utils;
rec {
2023-02-23 08:04:44 +01:00
KeycloakPostgresDB = customPkgs.mkPostgresDB {
name = "KeycloakPostgresDB";
database = "keycloak";
username = "keycloak";
# TODO: use passwordFile
password = "keycloak";
};
KeycloakService = customPkgs.mkKeycloakService {
name = "KeycloakService";
2023-03-07 09:21:20 +01:00
subdomain = "keycloak";
2023-02-23 08:04:44 +01:00
# Get these from infrastructure.nix
user = "keycloak";
group = "keycloak";
2023-03-07 09:21:20 +01:00
postgresServiceName = (getTarget distribution "KeycloakPostgresDB").containers.postgresql-database.service_name;
2023-02-23 08:04:44 +01:00
initialAdminUsername = "admin";
keys = {
dbPassword = "keycloakdbpassword";
initialAdminPassword = "keycloakinitialadmin";
};
logLevel = "INFO";
2023-03-07 09:21:20 +01:00
hostname = "keycloak.${getDomain distribution "KeycloakService"}";
2023-02-23 08:04:44 +01:00
dbType = "postgres";
dbDatabase = KeycloakPostgresDB.database;
dbUsername = KeycloakPostgresDB.username;
dbHost = {KeycloakPostgresDB}: KeycloakPostgresDB.target.properties.hostname;
2023-03-07 09:21:20 +01:00
dbPort = (getTarget distribution "KeycloakPostgresDB").containers.postgresql-database.port;
2023-02-23 08:04:44 +01:00
inherit KeycloakPostgresDB;
};
}