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}"