mirror of
https://github.com/ilyakooo0/nixpkgs.git
synced 2024-12-26 21:33:03 +03:00
c7df7f6361
This will help us catch PR that break the tarball creation, for example by breaking evaluation on other platforms.
42 lines
1.1 KiB
Bash
Executable File
42 lines
1.1 KiB
Bash
Executable File
#! /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
|
|
|
|
# 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
|
|
|
|
# Verify evaluation
|
|
echo "=== Verifying that nixpkgs evaluates..."
|
|
nix-env -f. -qa --json >/dev/null
|
|
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"
|
|
else
|
|
echo "=== Checking PR"
|
|
nox-review pr ${TRAVIS_PULL_REQUEST}
|
|
fi
|
|
echo "=== Checking tarball creation"
|
|
nix-build pkgs/top-level/release.nix -A tarball
|
|
else
|
|
echo "$0: Unknown option $1" >&2
|
|
false
|
|
fi
|