-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
default.nix
34 lines (28 loc) · 953 Bytes
/
default.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
{
pkgs ? import <nixpkgs> { },
}:
pkgs.mkShell {
buildInputs = with pkgs; [
postgresql_17
nodejs_23
prisma-engines
prisma
];
PGDATA = "${toString ./.}/.pg";
# PRISMA_MIGRATION_ENGINE_BINARY = "${pkgs.prisma-engines}/bin/migration-engine";
PRISMA_QUERY_ENGINE_BINARY = "${pkgs.prisma-engines}/bin/query-engine";
PRISMA_QUERY_ENGINE_LIBRARY = "${pkgs.prisma-engines}/lib/libquery_engine.node";
PRISMA_INTROSPECTION_ENGINE_BINARY = "${pkgs.prisma-engines}/bin/introspection-engine";
PRISMA_FMT_BINARY = "${pkgs.prisma-engines}/bin/prisma-fmt";
shellHook = ''
# PATH="$PWD/node_modules/.bin:$PATH";
pg_ctl stop
export PGHOST="$PGDATA"
[ ! -d $PGDATA ] && pg_ctl initdb -o "-U postgres"
pg_ctl -o "-p 2000 -k $PGDATA" start
echo "log_min_messages = warning" >> $PGDATA/postgresql.conf
echo "log_checkpoints = off" >> $PGDATA/postgresql.conf
cd ${toString ./.}
npm run dev
'';
}