{ pkgs ? import <nixpkgs> {} }:

pkgs.mkShell {
  buildInputs = [
    pkgs.postgresql
  ];

  shellHook = ''
    echo "Starting PostgreSQL..."
    initdb -D ./pgdata --locale=en_US.UTF-8 || true
    pg_ctl -D ./pgdata -l ./pgdata/logfile start
    echo "PostgreSQL is running!"
  '';
}
