Use .cabal-sandbox/bin/project instead of ./.cabal-sandbox/bin/project in target definition, as the latter isn't recognized on Mac OSX.
Don't sudo to user postgres for db:create, as that user does not exist on the default homebrew postgres setup on Mac OSX.

Now, whoever runs 'rivet db:create' should have whatever needed permissions. On linux, this is usually the 'postgres' user. On mac's (with homebrew and the default setup) this is probably the normal user.