Skyler Grey | 22428b0 | 2023-11-19 13:20:56 +0000 | [diff] [blame] | 1 | { 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 Grey | 915067d | 2023-12-03 13:46:53 +0000 | [diff] [blame^] | 19 | systemd.services.keycloak.requires = [ "postgresql.service" ]; |
| 20 | |
Skyler Grey | 0e05d26 | 2023-10-09 07:04:36 +0000 | [diff] [blame] | 21 | services.keycloak = { |
| 22 | enable = true; |
| 23 | settings = { |
| 24 | http-host = "127.0.0.1"; |
| 25 | http-port = 9083; |
| 26 | https-port = 9084; |
| 27 | http-enabled = true; |
| 28 | |
| 29 | proxy = "edge"; |
| 30 | |
| 31 | # https-port = 9084; |
| 32 | hostname = "login.clicks.codes"; |
| 33 | hostname-strict = false; |
| 34 | |
Skyler Grey | 22428b0 | 2023-11-19 13:20:56 +0000 | [diff] [blame] | 35 | https-certificate-file = "${./keycloak/login.clicks.codes.rsa.cert.pem}"; |
| 36 | https-certificate-key-file = config.sops.secrets.keycloak_rsa_private_key.path; |
Skyler Grey | 0e05d26 | 2023-10-09 07:04:36 +0000 | [diff] [blame] | 37 | }; |
| 38 | database = { |
| 39 | createLocally = false; |
| 40 | port = config.services.postgresql.port; |
| 41 | passwordFile = config.sops.secrets.clicks_keycloak_db_password.path; |
| 42 | }; |
| 43 | }; |
Skyler Grey | 22428b0 | 2023-11-19 13:20:56 +0000 | [diff] [blame] | 44 | |
Skyler Grey | 0e05d26 | 2023-10-09 07:04:36 +0000 | [diff] [blame] | 45 | } |