mirror of
https://github.com/cachix/install-nix-action.git
synced 2024-11-25 09:58:03 +00:00
take 2
This commit is contained in:
parent
c5729e9110
commit
712fbc2bf9
1 changed files with 3 additions and 9 deletions
|
@ -1,12 +1,9 @@
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
|
|
||||||
profileEnv=$HOME/.nix-profile/etc/profile.d/nix.sh
|
# Set paths early (ephemeral self-hosted runners might reuse a runner)
|
||||||
|
echo "/nix/var/nix/profiles/per-user/$USER/profile/bin" >> "$GITHUB_PATH"
|
||||||
# if Nix profile already exists, source the environment. This is mostly useful for self-hosted runners, see issue #98
|
echo "/nix/var/nix/profiles/default/bin" >> "$GITHUB_PATH"
|
||||||
if [[ -f $profileEnv ]]; then
|
|
||||||
source $profileEnv
|
|
||||||
fi
|
|
||||||
|
|
||||||
if type -p nix &>/dev/null ; then
|
if type -p nix &>/dev/null ; then
|
||||||
echo "Aborting: Nix is already installed at $(type -p nix)"
|
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"
|
sudo launchctl setenv NIX_SSL_CERT_FILE "$cert_file"
|
||||||
fi
|
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
|
if [[ $INPUT_NIX_PATH != "" ]]; then
|
||||||
echo "NIX_PATH=${INPUT_NIX_PATH}" >> "$GITHUB_ENV"
|
echo "NIX_PATH=${INPUT_NIX_PATH}" >> "$GITHUB_ENV"
|
||||||
|
|
Loading…
Reference in a new issue