Skip to content

Instantly share code, notes, and snippets.

@flokli
Last active August 12, 2019 14:16
Show Gist options
  • Save flokli/b9377bfb4b7e0ce2d6dc8bd3243e3104 to your computer and use it in GitHub Desktop.
Save flokli/b9377bfb4b7e0ce2d6dc8bd3243e3104 to your computer and use it in GitHub Desktop.
#!/usr/bin/env bash
nixBuild() {
DRV=$(nix-instantiate "$@");
nix-build $DRV --builders "" --no-out-link;
S=$?;
if [ $S -ne 0 ]; then
# trigger a git bisect bad if the bad line was found
nix log $DRV | grep -i "has terminated unexpectedly during startup" && exit 42;
# else trigger a skip (some other random build failure)
exit 125;
fi;
# build was successful
exit 0
}
nixBuild nixos/tests/virtualbox.nix -A simple-cli
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment