Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
#!/usr/bin/env bash
# usage:
# bash <(curl -sS https://gist.githubusercontent.com/timbertson/f643b8ae3a175ba8da7f/raw/travis-nix-bootstrap.sh)
# source $HOME/.nix-profile/etc/profile.d/nix.sh
_() {
set -eu
export NIX_CURL_FLAGS=-sS
if [ ! -e /nix ]; then
if [ "${CI:-null}" != "true" ]; then
echo "It looks like you're not a CI server, and you don't have a /nix folder. Aborting."
exit 1
fi
echo "=== Installing Nix..."
# Install Nix
bash <(curl -sS https://nixos.org/nix/install)
# 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
fi
}
_
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.