try fix script

This commit is contained in:
2025-03-17 12:48:50 +04:00
parent 3db3606686
commit 883acbe6d4
2 changed files with 4 additions and 5 deletions

View File

@@ -5,8 +5,7 @@
outputs = _: { outputs = _: {
lib = { lib = {
mkLib = pkgs: pwd: import ./lib.nix { inherit pkgs pwd; }; mkLib = pkgs: import ./lib.nix { inherit pkgs; };
}; };
}; };
} }

View File

@@ -1,7 +1,7 @@
{ pkgs, pwd }: { pkgs, pwd }:
let let
inherit (pkgs) lib; inherit (pkgs) lib;
runtime = builtins.toString pwd + "/.compose"; runtime = ".compose";
in in
{ {
mkWrapper = mkWrapper =
@@ -122,7 +122,7 @@ in
echo "PostgreSQL initdb process completed" echo "PostgreSQL initdb process completed"
echo echo
fi fi
cp ${configFile} ${data_dir}/postgresql.conf cp ${configFile} $PGDATA/postgresql.conf
if [[ "$POSTGRES_RUN_INITIAL_SCRIPT" == "true" ]]; then if [[ "$POSTGRES_RUN_INITIAL_SCRIPT" == "true" ]]; then
echo echo
echo "PostgreSQL is setting up the initial database" echo "PostgreSQL is setting up the initial database"
@@ -142,7 +142,7 @@ in
name = "run-postgres"; name = "run-postgres";
text = '' text = ''
set -euo pipefail set -euo pipefail
export PGDATA=${data_dir} PGHOST=${runtimeDir} PGPORT=${builtins.toString port} export PGDATA=$(realpath ${data_dir}) PGHOST=$(realpath (${runtimeDir}) PGPORT=${builtins.toString port}
mkdir -p ${lib.escapeShellArg runtimeDir} mkdir -p ${lib.escapeShellArg runtimeDir}
${setupScript}/bin/setup-postgres ${setupScript}/bin/setup-postgres
${package}/bin/postgres ${package}/bin/postgres