From edea6b21d94e36637edbf3714795dd27aab86aae Mon Sep 17 00:00:00 2001 From: zack Date: Mon, 21 Oct 2024 21:09:29 -0400 Subject: [PATCH] add port --- flake.nix | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/flake.nix b/flake.nix index fea9890..b958bd9 100644 --- a/flake.nix +++ b/flake.nix @@ -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}"