fix script
This commit is contained in:
12
lib.nix
12
lib.nix
@@ -108,9 +108,14 @@ in
|
|||||||
)
|
)
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
setupScript = pkgs.writeShellScriptBin "setup-postgres" ''
|
setupScript = pkgs.writeShellApplication {
|
||||||
set -euo pipefail
|
name = "setup-postgres";
|
||||||
export PATH=${package}/bin:${pkgs.coreutils}/bin
|
runtimeInputs = [
|
||||||
|
package
|
||||||
|
pkgs.coreutils
|
||||||
|
pkgs.gnused
|
||||||
|
];
|
||||||
|
text = ''
|
||||||
POSTGRES_RUN_INITIAL_SCRIPT="false"
|
POSTGRES_RUN_INITIAL_SCRIPT="false"
|
||||||
if [[ ! -d "$PGDATA" ]]; then
|
if [[ ! -d "$PGDATA" ]]; then
|
||||||
initdb --no-instructions
|
initdb --no-instructions
|
||||||
@@ -134,6 +139,7 @@ in
|
|||||||
|
|
||||||
unset POSTGRES_RUN_INITIAL_SCRIPT
|
unset POSTGRES_RUN_INITIAL_SCRIPT
|
||||||
'';
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
script = pkgs.writeShellApplication {
|
script = pkgs.writeShellApplication {
|
||||||
name = "run-postgres";
|
name = "run-postgres";
|
||||||
|
|||||||
Reference in New Issue
Block a user