Skip to content

Instantly share code, notes, and snippets.

@yorickvP
Created March 10, 2019 16:41
Show Gist options
  • Select an option

  • Save yorickvP/1fce4cbceb96bb1a11f786880d6e804f to your computer and use it in GitHub Desktop.

Select an option

Save yorickvP/1fce4cbceb96bb1a11f786880d6e804f to your computer and use it in GitHub Desktop.
withPostgreSQL = drv: pkgs.haskell.lib.overrideCabal drv (a: {
testToolDepends = (a.testToolDepends or []) ++
[ pkgs.ephemeralpg pkgs.postgresql pkgs.getopt ];
preCheck = (a.preCheck or "") + ''
export TEST_PG_CONN_STRING=$(pg_tmp -w 600)
'';
# we need the temporary directory from pg_tmp
# so extract it out of $TEST_PG_CONN_STRING
postCheck = (a.postCheck or "") + ''
pg_tmp stop -d $(echo ''${TEST_PG_CONN_STRING#*=} | sed 's:%2F:/:g')
'';
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment