Skip to content

Instantly share code, notes, and snippets.

@chessai
Created December 21, 2017 03:24
Show Gist options
  • Save chessai/003c86adac8276d6935051381e5cd39b to your computer and use it in GitHub Desktop.
Save chessai/003c86adac8276d6935051381e5cd39b to your computer and use it in GitHub Desktop.
#!/usr/bin/env bash
set -e
nix_opts='--show-trace --option extra-binary-caches https://nixcache.reflex-frp.org'
# use succ_opts when builds succeed
succ_opts='-j -8 -Q'
# use fail_opts when builds fail (for debugging with nix)
fail_opts='-j -1 --keep-going'
static=$(nix-build $nix_opts $fail_opts frontend.nix | tail -n 1)
if [ -z $static ]; then
echo "frontend build failed"
exit 1
fi
echo "$static"
nix-build $nix_opts $fail_opts ../../backend/server
echo 'starting server ...'
./result/bin/server --static "$static" "$@"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment