move keycloak db to consolidated location
This commit is contained in:
parent
e7f8bfc8f9
commit
957eefe97e
2 changed files with 37 additions and 0 deletions
|
@ -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
35
keycloak/default.nix
Normal 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;
|
||||
};
|
||||
}
|
Loading…
Reference in a new issue