blob: e1588250f44a6d6ecdd47faf038fc388df5dbec2 [file] [log] [blame]
Skyler Grey22428b02023-11-19 13:20:56 +00001{ config, lib, ... }: {
2 sops.secrets.keycloak_rsa_private_key = {
3 mode = "0600";
4 owner = "keycloak";
5 group = "keycloak";
6 sopsFile = ../../secrets/keycloak_rsa_private_key.pem;
7 format = "binary";
8 };
9
10 users.users.keycloak = {
11 isSystemUser = true;
12 createHome = true;
13 home = "/var/keycloak";
14 group = "keycloak";
15 };
16 users.groups.keycloak = {};
17 systemd.services.keycloak.serviceConfig.DynamicUser = lib.mkForce false;
18
Skyler Grey0e05d262023-10-09 07:04:36 +000019 services.keycloak = {
20 enable = true;
21 settings = {
22 http-host = "127.0.0.1";
23 http-port = 9083;
24 https-port = 9084;
25 http-enabled = true;
26
27 proxy = "edge";
28
29 # https-port = 9084;
30 hostname = "login.clicks.codes";
31 hostname-strict = false;
32
Skyler Grey22428b02023-11-19 13:20:56 +000033 https-certificate-file = "${./keycloak/login.clicks.codes.rsa.cert.pem}";
34 https-certificate-key-file = config.sops.secrets.keycloak_rsa_private_key.path;
Skyler Grey0e05d262023-10-09 07:04:36 +000035 };
36 database = {
37 createLocally = false;
38 port = config.services.postgresql.port;
39 passwordFile = config.sops.secrets.clicks_keycloak_db_password.path;
40 };
41 };
Skyler Grey22428b02023-11-19 13:20:56 +000042
Skyler Grey0e05d262023-10-09 07:04:36 +000043}