mirror of
https://github.com/juspay/services-flake.git
synced 2024-09-19 08:17:11 +03:00
parent
62fe23fbef
commit
8c25972cfb
@ -45,7 +45,7 @@
|
|||||||
pgcfg = config.services.postgres.pg1;
|
pgcfg = config.services.postgres.pg1;
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
environment.PGWEB_DATABASE_URL = "postgres://$USER@${pgcfg.listen_addresses}:${builtins.toString pgcfg.port}/${dbName}";
|
environment.PGWEB_DATABASE_URL = pgcfg.connectionURI dbName;
|
||||||
command = pkgs.pgweb;
|
command = pkgs.pgweb;
|
||||||
depends_on."pg1".condition = "process_healthy";
|
depends_on."pg1".condition = "process_healthy";
|
||||||
};
|
};
|
||||||
|
@ -56,6 +56,14 @@ in
|
|||||||
description = "The DB socket directory";
|
description = "The DB socket directory";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
# Based on: https://www.postgresql.org/docs/current/libpq-connect.html#LIBPQ-CONNSTRING-URIS
|
||||||
|
connectionURI = lib.mkOption {
|
||||||
|
type = lib.types.functionTo lib.types.str;
|
||||||
|
readOnly = true;
|
||||||
|
default = dbName: "postgres://${config.listen_addresses}:${builtins.toString config.port}/${dbName}";
|
||||||
|
description = "A function that accepts database name and returns the [postgres connection URI](https://www.postgresql.org/docs/current/libpq-connect.html#LIBPQ-CONNSTRING-URIS)";
|
||||||
|
};
|
||||||
|
|
||||||
hbaConf =
|
hbaConf =
|
||||||
let
|
let
|
||||||
hbaConfSubmodule = lib.types.submodule {
|
hbaConfSubmodule = lib.types.submodule {
|
||||||
|
Loading…
Reference in New Issue
Block a user