2
2
mirror of https://git.feal.no/felixalb/nixos-config.git synced 2024-12-23 12:37:30 +01:00
nixos-config/hosts/defiant/services/keycloak.nix

33 lines
783 B
Nix
Raw Normal View History

2024-06-10 10:45:59 +02:00
{ config, pkgs, lib, ... }:
let
cfg = config.services.keycloak.settings;
in {
sops.secrets."keycloak/postgres" = { };
services.keycloak = {
enable = true;
database = {
type = "postgresql";
createLocally = true;
username = "keycloak";
passwordFile = config.sops.secrets."keycloak/postgres".path;
};
settings = {
cache = "local";
2024-12-01 11:05:19 +01:00
hostname = "https://iam.feal.no";
hostname-backchannel-dynamic = false;
http-enabled = true;
2024-06-10 10:45:59 +02:00
http-host = "127.0.1.2";
http-port = 5060;
2024-12-01 11:05:19 +01:00
proxy-headers = "xforwarded";
2024-06-10 10:45:59 +02:00
};
};
# The main reverse proxy is defined in ./nginx.nix
services.nginx.virtualHosts.${cfg.hostname} = {
2024-12-01 11:05:19 +01:00
locations."= /".return = "302 ${cfg.hostname}/realms/feal.no/account";
2024-06-10 10:45:59 +02:00
};
}