<commit_before>#! /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 sh -c 'echo "build-max-jobs = 4" > /etc/nix/nix.conf'

    # Verify evaluation
    echo "=== Verifying that nixpkgs evaluates..."
    nix-env -f. -qa --json >/dev/null
elif [[ $1 == nox ]]; then
    source $HOME/.nix-profile/etc/profile.d/nix.sh
    echo "=== Installing nox..."
    nix-build -A nox '<nixpkgs>' --show-trace
elif [[ $1 == build ]]; then
    source $HOME/.nix-profile/etc/profile.d/nix.sh

    if [[ $TRAVIS_OS_NAME == "osx" ]]; then
        echo "Skipping NixOS things on darwin"
    else
        echo "=== Checking NixOS options"
        nix-build nixos/release.nix -A options --show-trace

        echo "=== Checking tarball creation"
        nix-build pkgs/top-level/release.nix -A tarball --show-trace
    fi

    if [[ $TRAVIS_PULL_REQUEST == false ]]; then
        echo "=== Not a pull request"
    else<commit_msg>travis-ci: attempt to fix linux builds<commit_after>#! /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 sh -c 'echo "build-max-jobs = 4" > /etc/nix/nix.conf'

    # Nix builds in /tmp and we need exec support
    sudo mount
    sudo mount -o remount,exec /run

    # Verify evaluation
    echo "=== Verifying that nixpkgs evaluates..."
    nix-env -f. -qa --json >/dev/null
elif [[ $1 == nox ]]; then
    source $HOME/.nix-profile/etc/profile.d/nix.sh
    echo "=== Installing nox..."
    nix-build -A nox '<nixpkgs>' --show-trace
elif [[ $1 == build ]]; then
    source $HOME/.nix-profile/etc/profile.d/nix.sh

    if [[ $TRAVIS_OS_NAME == "osx" ]]; then
        echo "Skipping NixOS things on darwin"
    else
        echo "=== Checking NixOS options"
        nix-build nixos/release.nix -A options --show-trace

        echo "=== Checking tarball creation"
        nix-build pkgs/top-level/release.nix -A tarball --show-trace
    fi

    if [[ $TRAVIS_PULL_REQUEST == false ]]; then
        echo "=== Not a pull request"
    else
{'fraction_non_alphanumeric': 0.15212981744421908, 'fraction_numerical': 0.0032454361054766734, 'mean_word_length': 2.3324324324324324, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 9, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7476520', 'n_tokens_mistral': 928, 'n_tokens_neox': 860, 'n_words': 244}