Skip to content

Commit

Permalink
test with new release
Browse files Browse the repository at this point in the history
  • Loading branch information
domenkozar committed May 26, 2020
1 parent d3c3fef commit f87488f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 20 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/test.yml
Expand Up @@ -6,14 +6,16 @@ jobs:
tests:
strategy:
matrix:
os: [ubuntu-18.04, macos-latest]
os: [ubuntu-latest, macos-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- run: yarn install --frozen-lockfile
- run: yarn build
- name: Install Nix
uses: ./
with:
install_url: https://static.domenkozar.com/install-2.3.5-pre
- run: nix-env -iA cachix -f https://github.com/NixOS/nixpkgs/tarball/ab5863afada3c1b50fc43bf774b75ea71b287cde
- run: cat /etc/nix/nix.conf
# cachix should be available and be able to configure a cache
Expand Down
24 changes: 5 additions & 19 deletions lib/install-nix.sh
Expand Up @@ -3,15 +3,6 @@ set -euo pipefail

export here=$(dirname "${BASH_SOURCE[0]}")

nixConf() {
sudo mkdir -p /etc/nix
# Workaround a segfault: https://github.com/NixOS/nix/issues/2733
sudo sh -c 'echo http2 = false >> /etc/nix/nix.conf'
# Set jobs to number of cores
sudo sh -c 'echo max-jobs = auto >> /etc/nix/nix.conf'
# Allow binary caches for runner user
sudo sh -c 'echo trusted-users = root runner >> /etc/nix/nix.conf'
}

if [[ $OSTYPE =~ darwin ]]; then
# Catalina workaround https://github.com/NixOS/nix/issues/2925
Expand All @@ -21,15 +12,13 @@ if [[ $OSTYPE =~ darwin ]]; then
sudo mdutil -i off /nix
fi

nixConf
# Set jobs to number of cores
sudo sh -c 'echo max-jobs = auto >> /tmp/nix.conf'
# Allow binary caches for runner user
sudo sh -c 'echo trusted-users = root runner >> /tmp/nix.conf'

# Needed due to multi-user being too defensive
export ALLOW_PREEXISTING_INSTALLATION=1

sh <(curl -L ${INPUT_INSTALL_URL:-https://nixos.org/nix/install}) --daemon

# write nix.conf again as installation overwrites it
nixConf
sh <(curl -L ${INPUT_INSTALL_URL:-https://nixos.org/nix/install}) --daemon --daemon-user-count 4 --nix-extra-conf-file /tmp/nix.conf

# macOS needs certificates hints
if [[ $OSTYPE =~ darwin ]]; then
Expand All @@ -39,9 +28,6 @@ if [[ $OSTYPE =~ darwin ]]; then
sudo launchctl setenv NIX_SSL_CERT_FILE "$cert_file"
fi

# Reload the daemon to pick up changes
sudo pkill -HUP nix-daemon

# Set paths
echo "::add-path::/nix/var/nix/profiles/per-user/runner/profile/bin"
echo "::add-path::/nix/var/nix/profiles/default/bin"
Expand Down

0 comments on commit f87488f

Please sign in to comment.