fix script

This commit is contained in:
2025-03-17 13:38:21 +04:00
parent c7d116be87
commit f5ab052719

12
lib.nix
View File

@@ -108,9 +108,14 @@ in
)
);
};
setupScript = pkgs.writeShellScriptBin "setup-postgres" ''
set -euo pipefail
export PATH=${package}/bin:${pkgs.coreutils}/bin
setupScript = pkgs.writeShellApplication {
name = "setup-postgres";
runtimeInputs = [
package
pkgs.coreutils
pkgs.gnused
];
text = ''
POSTGRES_RUN_INITIAL_SCRIPT="false"
if [[ ! -d "$PGDATA" ]]; then
initdb --no-instructions
@@ -134,6 +139,7 @@ in
unset POSTGRES_RUN_INITIAL_SCRIPT
'';
};
script = pkgs.writeShellApplication {
name = "run-postgres";