A reproducible development environment providing a PostgreSQL measurement database with MinIO object storage, designed for local experiments and data-driven workflows.
This flake sets up:
- π PostgreSQL 15 β local database instance for structured measurement data
- πͺ£ MinIO β lightweight, S3-compatible object storage
- π§© Automatic initialization of
postgresql.confandpg_hba.conffrom external files - πΎ Persistent local data directories under
./data/
arbok_database/
βββ flake.nix
βββ config/
β βββ postgresql.conf # Custom PostgreSQL configuration template
β βββ pg_hba.conf # Host-based authentication config
βββ data/ # Created automatically by shellHook
β βββ pgdata/ # PostgreSQL data directory (after initdb)
β βββ pgsock/ # UNIX socket directory for PostgreSQL
β βββ minio/ # MinIO data storage root
βββ minio.log # Runtime log written when MinIO starts
nix develop
### Start/Stop PostgreSQL
pg_ctl -D "$PGDATA" -o "-k $PGSOCKET" -l logfile start
pg_ctl -D "$PGDATA" -o "-k $PGSOCKET" stopiMinIO starts automatically when entering the shell. You can stop it manually using:
stopminioExample pythin connection using TCP:
from sqlalchemy import create_engine
engine = create_engine("postgresql+psycopg2://localhost:5432/postgres")or via Unix socket:
socket_dir = "/path/to/data/pgsock"
engine = create_engine(f"postgresql+psycopg2:///postgres?host={socket_dir}")- Data is stored under
./data, so you can safely rebuild or re-enter the flake shell withoutloosing data - Logs are written to
data/mini.log - The configuration files (
postgresql.conf andpg_hba.conf`) can be customized outside the flake and are imported and configured automatically