If Nix profile environment exist, source it before installation check
This commit is contained in:
parent
3e0e991ad2
commit
c5729e9110
@ -1,6 +1,13 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
set -euo pipefail
|
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
|
||||||
|
|
||||||
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)"
|
||||||
exit
|
exit
|
||||||
|
Loading…
Reference in New Issue
Block a user