infra/hosts/nachtigall/apps/keycloak.nix

49 lines
1,010 B
Nix
Raw Normal View History

2023-10-28 13:05:30 +00:00
{
flake,
config,
lib,
pkgs,
...
}: {
age.secrets.keycloak-database-password = {
file = "${flake.self}/secrets/keycloak-database-password.age";
mode = "700";
#owner = "keycloak";
};
2023-10-28 19:34:45 +00:00
services.nginx.virtualHosts."auth.pub.solar" = {
enableACME = true;
forceSSL = true;
locations = {
"= /" = {
extraConfig = ''
return 302 /realms/pub.solar/account;
'';
};
2023-10-28 19:34:45 +00:00
"/" = {
extraConfig = ''
proxy_pass http://127.0.0.1:8080;
2023-10-28 19:34:45 +00:00
'';
};
};
2023-10-28 13:05:30 +00:00
};
# keycloak
services.keycloak = {
enable = true;
database.passwordFile = config.age.secrets.keycloak-database-password.path;
settings = {
hostname = "auth.pub.solar";
http-host = "127.0.0.1";
http-port = 8080;
proxy = "edge";
features = "declarative-user-profile";
};
themes = {
"pub.solar" = flake.inputs.keycloak-theme-pub-solar.legacyPackages.${pkgs.system}.keycloak-theme-pub-solar;
2023-10-28 13:05:30 +00:00
};
};
}