flake/hosts/tyo0/services/keycloak.nix

33 lines
642 B
Nix
Raw Normal View History

2024-09-06 12:19:44 +00:00
{
lib,
config,
pkgs,
...
}:
let
port = config.lib.ports.keycloak;
in
{
2024-08-11 10:13:36 +00:00
services.keycloak = {
enable = true;
settings = {
cache = "local";
hostname = "id.ny4.dev";
http-host = "127.0.0.1";
2024-09-06 12:19:44 +00:00
http-port = port;
2024-08-11 10:13:36 +00:00
proxy = "edge";
};
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 {
match = lib.singleton {
host = [ "id.ny4.dev" ];
};
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
}