diff --git a/flake.nix b/flake.nix index a3c3151..0724c8e 100644 --- a/flake.nix +++ b/flake.nix @@ -5,8 +5,7 @@ outputs = _: { lib = { - mkLib = pkgs: pwd: import ./lib.nix { inherit pkgs pwd; }; + mkLib = pkgs: import ./lib.nix { inherit pkgs; }; }; }; } - diff --git a/lib.nix b/lib.nix index 0f74e68..59e6edc 100644 --- a/lib.nix +++ b/lib.nix @@ -1,7 +1,7 @@ { pkgs, pwd }: let inherit (pkgs) lib; - runtime = builtins.toString pwd + "/.compose"; + runtime = ".compose"; in { mkWrapper = @@ -122,7 +122,7 @@ in echo "PostgreSQL initdb process completed" echo fi - cp ${configFile} ${data_dir}/postgresql.conf + cp ${configFile} $PGDATA/postgresql.conf if [[ "$POSTGRES_RUN_INITIAL_SCRIPT" == "true" ]]; then echo echo "PostgreSQL is setting up the initial database" @@ -142,7 +142,7 @@ in name = "run-postgres"; text = '' 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} ${setupScript}/bin/setup-postgres ${package}/bin/postgres