This commit is contained in:
zack 2024-10-21 21:09:29 -04:00
parent c8e029888a
commit edea6b21d9
No known key found for this signature in database
GPG key ID: 5F873416BCF59F35

View file

@ -100,6 +100,12 @@
example = default;
description = "Database host";
};
port = mkOption rec {
type = types.int;
default = 5432;
example = default;
description = "Database port";
};
};
enableServer = mkOption rec {
@ -194,7 +200,7 @@
if cfg.phx.database.passwordFile != null
then ''
export DB_PASSWORD=$(cat ${cfg.phx.database.passwordFile})
export DATABASE_URL="ecto://${cfg.phx.database.user}:$DB_PASSWORD@${cfg.phx.database.host}/${cfg.phx.database.name}"
export DATABASE_URL="ecto://${cfg.phx.database.user}:$DB_PASSWORD@${cfg.phx.database.host}:${toString cfg.phx.database.port}/${cfg.phx.database.name}"
''
else ''
export DATABASE_URL="ecto://${cfg.phx.database.user}@${cfg.phx.database.host}/${cfg.phx.database.name}"