1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2024-11-23 22:20:51 +00:00
nixpkgs/maintainers/scripts/travis-nox-review-pr.sh

43 lines
1.2 KiB
Bash
Raw Normal View History

2014-09-21 12:09:35 +01:00
#! /usr/bin/env bash
set -e
export NIX_CURL_FLAGS=-sS
if [[ $1 == nix ]]; then
echo "=== Installing Nix..."
# Install Nix
bash <(curl -sS https://nixos.org/nix/install)
source $HOME/.nix-profile/etc/profile.d/nix.sh
2014-09-21 12:09:35 +01:00
# Make sure we can use hydra's binary cache
sudo mkdir /etc/nix
sudo tee /etc/nix/nix.conf <<EOF >/dev/null
binary-caches = http://cache.nixos.org http://hydra.nixos.org
trusted-binary-caches = http://hydra.nixos.org
build-max-jobs = 4
EOF
2014-09-21 12:09:35 +01:00
# Verify evaluation
echo "=== Verifying that nixpkgs evaluates..."
nix-env -f. -qa --json >/dev/null
2014-10-15 10:23:34 +01:00
elif [[ $1 == nox ]]; then
echo "=== Installing nox..."
git clone -q https://github.com/madjar/nox
pip --quiet install -e nox
elif [[ $1 == build ]]; then
source $HOME/.nix-profile/etc/profile.d/nix.sh
if [[ $TRAVIS_PULL_REQUEST == false ]]; then
echo "===> Not a pull request, checking evaluation"
nix-build pkgs/top-level/release.nix -A tarball
else
echo "=== Checking PR"
# The current HEAD is the PR merged into origin/master, so we compare
# against origin/master
nox-review wip --against origin/master
fi
else
echo "$0: Unknown option $1" >&2
false
2014-09-21 12:09:35 +01:00
fi