network_inventory/.envrc

13 lines
376 B
Plaintext
Raw Normal View History

2022-01-31 20:50:16 +01:00
use flake
2022-03-01 10:04:34 +01:00
eval "$shellHook"
2023-07-12 23:16:32 +02:00
layout_postgres() {
export PGDATA="$(direnv_layout_dir)/postgres"
export PGHOST="$PGDATA"
if [[ ! -d "$PGDATA" ]]; then
initdb
echo -e "listen_addresses = ''\nunix_socket_directories = '$PGHOST'" >> "$PGDATA/postgresql.conf"
echo "CREATE DATABASE $USER;" | postgres --single -E postgres
fi
}
layout postgres