nix: avoid updating cabal on every run

Resolves #4206
This commit is contained in:
Wolfgang Walther
2025-07-17 11:47:44 -05:00
committed by Steve Chavez
parent 66caaffbe3
commit 25e56f32e4
4 changed files with 26 additions and 16 deletions
+12 -2
View File
@@ -15,7 +15,6 @@ let
withEnv = postgrest.env;
}
''
${cabal-install}/bin/cabal v2-update
exec ${cabal-install}/bin/cabal v2-build ${devCabalOptions} "''${_arg_leftovers[@]}"
'';
@@ -34,6 +33,17 @@ let
exec ${cabal-install}/bin/cabal v2-clean
'';
update =
checkedShellScript
{
name = "postgrest-cabal-update";
docs = "Update cabal's package list from hackage.haskell.org";
workingDir = "/";
}
''
exec ${cabal-install}/bin/cabal v2-update
'';
run =
checkedShellScript
{
@@ -85,7 +95,6 @@ let
export PGRST_DB_POOL_ACQUISITION_TIMEOUT
export PGRST_JWT_SECRET
${cabal-install}/bin/cabal v2-update
${cabal-install}/bin/cabal --builddir="dist-prof" v2-build --enable-profiling --disable-shared exe:postgrest
${cabal-install}/bin/cabal --builddir="dist-prof" v2-run -- \
postgrest +RTS -p -h -RTS "''${_arg_leftovers[@]}"
@@ -111,6 +120,7 @@ buildToolbox
inherit
build
clean
update
run
runProfiled
repl;