Compare commits

...

4 Commits

4 changed files with 13 additions and 26 deletions

View File

@ -19,4 +19,9 @@
./postgres.nix
./security
];
nix.settings = {
cores = 2;
max-jobs = 4;
};
}

View File

@ -3,49 +3,30 @@ let
port = 8086;
domain = "beta.auth.${common.domain}";
dbPassKey = "keycloak/database-pass";
cfg = config.services.keycloak;
in
{
services = {
keycloak = {
enable = true;
settings = {
hostname = domain;
hostname = "https://${domain}";
http-port = port;
http-enabled = true;
};
database = {
type = "postgresql";
createLocally = false;
host = "localhost";
createLocally = true;
port = config.services.postgresql.settings.port;
name = "keycloak";
username = "keycloak";
passwordFile = config.sops.secrets.${dbPassKey}.path;
useSSL = false;
};
initialAdminPassword = "changeme";
};
nginx.virtualHosts."${domain}" = {
nginx.virtualHosts.${domain} = {
forceSSL = true;
enableACME = true;
locations = {
"/".proxyPass = "http://localhost:${toString port}";
};
};
postgresql =
let
psql = cfg.database;
in
{
ensureDatabases = [ psql.name ];
ensureUsers = [
{
name = psql.username;
ensureDBOwnership = true;
}
];
locations."/".proxyPass = "http://localhost:${toString port}";
};
};
sops.secrets.${dbPassKey} = { };

View File

@ -19,7 +19,7 @@ in
services = {
nextcloud = {
enable = true;
enable = false;
autoUpdateApps.enable = true;

View File

@ -84,6 +84,7 @@ in
"track.${domain}" = homelabProxy 8090;
# Donetick
"chore.${domain}" = homelabProxy 2021;
"recurring-events-api.${domain}" = homelabProxy 8095;
};
};