flake/hosts/aws/tyo0/services/keycloak.nix

32 lines
661 B
Nix
Raw Permalink Normal View History

2024-09-06 12:19:44 +00:00
{
lib,
pkgs,
2024-10-19 05:00:06 +00:00
ports,
2024-09-06 12:19:44 +00:00
...
}:
let
2024-10-19 05:00:06 +00:00
port = ports.keycloak;
2024-09-06 12:19:44 +00:00
in
{
2024-08-11 10:13:36 +00:00
services.keycloak = {
enable = true;
settings = {
cache = "local";
hostname = "id.ny4.dev";
2024-10-19 05:00:06 +00:00
http-enabled = true;
2024-08-11 10:13:36 +00:00
http-host = "127.0.0.1";
2024-09-06 12:19:44 +00:00
http-port = port;
2024-10-19 05:00:06 +00:00
proxy-headers = "xforwarded";
2024-08-11 10:13:36 +00:00
};
database.passwordFile = toString (pkgs.writeText "password" "keycloak");
};
2024-08-31 02:15:09 +00:00
services.caddy.settings.apps.http.servers.srv0.routes = lib.singleton {
2024-09-20 17:38:01 +00:00
match = lib.singleton { host = [ "id.ny4.dev" ]; };
2024-08-31 02:15:09 +00:00
handle = lib.singleton {
handler = "reverse_proxy";
2024-09-06 12:19:44 +00:00
upstreams = [ { dial = "localhost:${toString port}"; } ];
2024-08-31 02:15:09 +00:00
};
};
2024-08-11 10:13:36 +00:00
}