From 712fbc2bf94f397a90c5cf7ef2e4e5f159fbebab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Domen=20Ko=C5=BEar?= Date: Fri, 15 Oct 2021 16:45:20 -0500 Subject: [PATCH] take 2 --- lib/install-nix.sh | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/lib/install-nix.sh b/lib/install-nix.sh index eca7aa8..43b0130 100755 --- a/lib/install-nix.sh +++ b/lib/install-nix.sh @@ -1,12 +1,9 @@ #!/usr/bin/env bash set -euo pipefail -profileEnv=$HOME/.nix-profile/etc/profile.d/nix.sh - -# if Nix profile already exists, source the environment. This is mostly useful for self-hosted runners, see issue #98 -if [[ -f $profileEnv ]]; then - source $profileEnv -fi +# Set paths early (ephemeral self-hosted runners might reuse a runner) +echo "/nix/var/nix/profiles/per-user/$USER/profile/bin" >> "$GITHUB_PATH" +echo "/nix/var/nix/profiles/default/bin" >> "$GITHUB_PATH" if type -p nix &>/dev/null ; then echo "Aborting: Nix is already installed at $(type -p nix)" @@ -62,9 +59,6 @@ if [[ $OSTYPE =~ darwin ]]; then sudo launchctl setenv NIX_SSL_CERT_FILE "$cert_file" fi -# Set paths -echo "/nix/var/nix/profiles/per-user/$USER/profile/bin" >> "$GITHUB_PATH" -echo "/nix/var/nix/profiles/default/bin" >> "$GITHUB_PATH" if [[ $INPUT_NIX_PATH != "" ]]; then echo "NIX_PATH=${INPUT_NIX_PATH}" >> "$GITHUB_ENV"