From ac84906dad2e7819145f3852d6abbd1e6f369da1 Mon Sep 17 00:00:00 2001 From: Joshua Potter Date: Tue, 28 Nov 2023 10:56:18 -0700 Subject: [PATCH] Prefer $PWD/data over $PGDATA. Include additional `.gitignore` rules to phoenix spec. --- specs/phoenix/runner | 6 ++++++ specs/phoenix/template/README.md | 4 ++-- specs/postgres/template/README.md | 4 ++-- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/specs/phoenix/runner b/specs/phoenix/runner index 9d3a01a..3e87958 100755 --- a/specs/phoenix/runner +++ b/specs/phoenix/runner @@ -75,6 +75,12 @@ nix develop "$BUILD" --command bash -c "pg_ctl initdb -D $BUILD/data" cat <> "$BUILD"/.gitignore # The default location of the generated database cluster. /data/ + +# Directory used by \`direnv\` to hold \`use flake\`-generated profiles. +/.direnv/ + +# A symlink produced by default when running \`nix build\`. +/result EOF # ============================================================ diff --git a/specs/phoenix/template/README.md b/specs/phoenix/template/README.md index 02e2a22..a71b5b7 100644 --- a/specs/phoenix/template/README.md +++ b/specs/phoenix/template/README.md @@ -13,7 +13,7 @@ $> nix develop An empty Postgres cluster is initialized at `/data`. To start the database, run the following: ```bash -$> pg_ctl start -o --unix_socket_directories="$PGDATA" +$> pg_ctl start -o --unix_socket_directories="$PWD/data" ``` To shut the database down, run: ```bash @@ -21,7 +21,7 @@ $> pg_ctl stop ``` You can connect to this database from the project root directory by running: ```bash -$> psql -h "$PWD"/data -d postgres +$> psql -h "$PWD/data" -d postgres ``` Afterward, you can run the Phoenix setup commands: diff --git a/specs/postgres/template/README.md b/specs/postgres/template/README.md index c7887f3..87568d6 100644 --- a/specs/postgres/template/README.md +++ b/specs/postgres/template/README.md @@ -13,7 +13,7 @@ $> nix develop An empty Postgres cluster is initialized at `/data`. To start the database, run the following: ```bash -$> pg_ctl start -o --unix_socket_directories="$PGDATA" +$> pg_ctl start -o --unix_socket_directories="$PWD/data" ``` To shut the database down, run: ```bash @@ -21,5 +21,5 @@ $> pg_ctl stop ``` You can connect to this database from the project root directory by running: ```bash -$> psql -h "$PWD"/data -d postgres +$> psql -h "$PWD/data" -d postgres ```