1
0
Fork 0

move keycloak db to consolidated location

This commit is contained in:
ibizaman 2023-02-19 13:37:41 -08:00
parent e7f8bfc8f9
commit 957eefe97e
2 changed files with 37 additions and 0 deletions

View file

@ -29,6 +29,8 @@ let
mkKeycloakCliService = callPackage ./keycloak-cli-config/unit.nix {inherit utils;};
keycloak = callPackage ./keycloak {inherit utils customPkgs;};
ttrss = callPackage ./ttrss {inherit utils customPkgs;};
vaultwarden = callPackage ./vaultwarden {inherit utils customPkgs;};
};

35
keycloak/default.nix Normal file
View file

@ -0,0 +1,35 @@
{ customPkgs
, pkgs
, utils
}:
{ serviceName ? "Keycloak"
, subdomain ? "keycloak"
, database ?
{
name = subdomain;
username = "keycloak";
# TODO: use passwordFile
password = "keycloak";
}
}:
rec {
inherit subdomain;
inherit database;
db = customPkgs.mkPostgresDB {
name = "KeycloakPostgresDB";
database = database.name;
username = database.username;
# TODO: use passwordFile
password = database.password;
};
services = {
${db.name} = db;
};
distribute = on: {
${db.name} = on;
};
}