Skip Nix install in macOS runner bootstrap
This commit is contained in:
parent
b9fb30c18c
commit
9b642aa5b7
1 changed files with 4 additions and 32 deletions
|
|
@ -588,42 +588,14 @@ if ! command -v curl >/dev/null 2>&1; then
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if ! command -v nix >/dev/null 2>&1; then
|
# Apple build workflows do not require Nix just to bootstrap the Forgejo runner.
|
||||||
echo "Installing nix (Determinate Systems installer)..."
|
# If Nix is already present on the base image, keep it on PATH; otherwise leave
|
||||||
installer="/tmp/nix-installer.$$"
|
# installation to the job itself.
|
||||||
curl -fsSL -o "${installer}" https://install.determinate.systems/nix
|
|
||||||
chmod +x "${installer}"
|
|
||||||
|
|
||||||
if command -v sudo >/dev/null 2>&1; then
|
|
||||||
if sudo -n true 2>/dev/null; then
|
|
||||||
sudo -n sh "${installer}" install --no-confirm
|
|
||||||
else
|
|
||||||
sudo sh "${installer}" install --no-confirm
|
|
||||||
fi
|
|
||||||
else
|
|
||||||
sh "${installer}" install --no-confirm
|
|
||||||
fi
|
|
||||||
|
|
||||||
rm -f "${installer}"
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [[ -f /nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh ]]; then
|
if [[ -f /nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh ]]; then
|
||||||
# shellcheck disable=SC1091
|
# shellcheck disable=SC1091
|
||||||
. /nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh
|
. /nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh
|
||||||
fi
|
|
||||||
|
|
||||||
export PATH="/nix/var/nix/profiles/default/bin:/nix/var/nix/profiles/default/sbin:${PATH}"
|
export PATH="/nix/var/nix/profiles/default/bin:/nix/var/nix/profiles/default/sbin:${PATH}"
|
||||||
|
fi
|
||||||
# Flake builds need nix-command + flakes enabled. Workflows may layer additional
|
|
||||||
# config, but ensure a sane default exists.
|
|
||||||
mkdir -p "${XDG_CONFIG_HOME:-$HOME/.config}/nix"
|
|
||||||
cat > "${XDG_CONFIG_HOME:-$HOME/.config}/nix/nix.conf" <<'EOF'
|
|
||||||
experimental-features = nix-command flakes
|
|
||||||
sandbox = true
|
|
||||||
fallback = true
|
|
||||||
substituters = https://cache.nixos.org
|
|
||||||
trusted-public-keys = cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=
|
|
||||||
EOF
|
|
||||||
|
|
||||||
mkdir -p bin
|
mkdir -p bin
|
||||||
export PATH="${PWD}/bin:${PATH}"
|
export PATH="${PWD}/bin:${PATH}"
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue