mirror of
https://git.sr.ht/~rouven/nixos-config
synced 2025-01-18 17:11:39 +01:00
nuc: add keycloak
This commit is contained in:
parent
911fa95dd1
commit
525b92a65d
4 changed files with 46 additions and 3 deletions
|
@ -8,7 +8,8 @@
|
|||
./modules/backup
|
||||
./modules/cache
|
||||
# ./modules/grafana
|
||||
./modules/hydra
|
||||
# ./modules/hydra
|
||||
./modules/keycloak
|
||||
# ./modules/prometheus
|
||||
./modules/matrix
|
||||
./modules/mautrix-telegram
|
||||
|
@ -69,8 +70,6 @@
|
|||
programs.mosh.enable = true;
|
||||
|
||||
|
||||
# firmware updates
|
||||
services.fwupd.enable = true;
|
||||
users.users.root.initialHashedPassword = "$y$j9T$hYM7FT2hn3O7OWBn9uz8e0$XquxONcPSke6YjdRGwOzGxC0/92hgP7PIB0y0K.Qdr/";
|
||||
users.users.root.openssh.authorizedKeys.keyFiles = [
|
||||
../../keys/ssh/rouven-thinkpad
|
||||
|
|
43
hosts/nuc/modules/keycloak/default.nix
Normal file
43
hosts/nuc/modules/keycloak/default.nix
Normal file
|
@ -0,0 +1,43 @@
|
|||
{ config, ... }:
|
||||
let
|
||||
domain = "auth.${config.networking.domain}";
|
||||
in
|
||||
{
|
||||
age.secrets.keycloak = {
|
||||
file = ../../../../secrets/nuc/keycloak/db.age;
|
||||
};
|
||||
services.keycloak = {
|
||||
enable = true;
|
||||
settings = {
|
||||
http-port = 8084;
|
||||
https-port = 19000;
|
||||
hostname = domain;
|
||||
# proxy-headers = "forwarded";
|
||||
proxy = "edge";
|
||||
};
|
||||
database = {
|
||||
# host = "/var/run/postgresql/.s.PGSQL.5432";
|
||||
# useSSL = false;
|
||||
# createLocally = false;
|
||||
passwordFile = config.age.secrets.keycloak.path;
|
||||
};
|
||||
initialAdminPassword = "plschangeme";
|
||||
};
|
||||
# services.postgresql = {
|
||||
# enable = true;
|
||||
# ensureUsers = [
|
||||
# {
|
||||
# name = "keycloak";
|
||||
# ensureDBOwnership = true;
|
||||
# }
|
||||
# ];
|
||||
# ensureDatabases = [ "keycloak" ];
|
||||
# };
|
||||
services.nginx.virtualHosts."${domain}" = {
|
||||
enableACME = true;
|
||||
forceSSL = true;
|
||||
locations."/" = {
|
||||
proxyPass = "http://127.0.0.1:${toString config.services.keycloak.settings.http-port}";
|
||||
};
|
||||
};
|
||||
}
|
|
@ -20,6 +20,7 @@ in
|
|||
"secrets/nuc/matrix/sync.age".publicKeys = [ rouven nuc ];
|
||||
"secrets/nuc/mautrix-telegram/env.age".publicKeys = [ rouven nuc ];
|
||||
"secrets/nuc/vaultwarden.age".publicKeys = [ rouven nuc ];
|
||||
"secrets/nuc/keycloak/db.age".publicKeys = [ rouven nuc ];
|
||||
"secrets/nuc/cache.age".publicKeys = [ rouven nuc ];
|
||||
"secrets/nuc/borg/passphrase.age".publicKeys = [ rouven nuc ];
|
||||
"secrets/nuc/borg/key.age".publicKeys = [ rouven nuc ];
|
||||
|
|
BIN
secrets/nuc/keycloak/db.age
Normal file
BIN
secrets/nuc/keycloak/db.age
Normal file
Binary file not shown.
Loading…
Reference in a new issue