fix: install nix tooling in bootstrap workflow when missing
All checks were successful
Terraform Plan / Terraform Plan (push) Successful in 17s
All checks were successful
Terraform Plan / Terraform Plan (push) Successful in 17s
This commit is contained in:
@@ -107,13 +107,42 @@ jobs:
|
||||
|
||||
- name: Validate nix installation
|
||||
run: |
|
||||
if [ ! -x /nix/var/nix/profiles/default/bin/nix ]; then
|
||||
echo "Nix not found at /nix/var/nix/profiles/default/bin/nix"
|
||||
exit 1
|
||||
if [ -x /nix/var/nix/profiles/default/bin/nix ]; then
|
||||
/nix/var/nix/profiles/default/bin/nix --version
|
||||
exit 0
|
||||
fi
|
||||
|
||||
if command -v nix >/dev/null 2>&1; then
|
||||
nix --version
|
||||
exit 0
|
||||
fi
|
||||
|
||||
echo "Nix missing; installing no-daemon Nix for this runner job"
|
||||
sh <(curl -L https://nixos.org/nix/install) --no-daemon
|
||||
|
||||
if [ -f "$HOME/.nix-profile/etc/profile.d/nix.sh" ]; then
|
||||
. "$HOME/.nix-profile/etc/profile.d/nix.sh"
|
||||
fi
|
||||
|
||||
nix --version
|
||||
|
||||
- name: Install nixos-rebuild tool
|
||||
env:
|
||||
NIX_CONFIG: experimental-features = nix-command flakes
|
||||
run: |
|
||||
if [ -f "$HOME/.nix-profile/etc/profile.d/nix.sh" ]; then
|
||||
. "$HOME/.nix-profile/etc/profile.d/nix.sh"
|
||||
fi
|
||||
|
||||
nix profile install nixpkgs#nixos-rebuild
|
||||
|
||||
- name: Run cluster rebuild and bootstrap
|
||||
env:
|
||||
PATH: /nix/var/nix/profiles/default/bin:${{ env.PATH }}
|
||||
NIX_CONFIG: experimental-features = nix-command flakes
|
||||
PATH: $HOME/.nix-profile/bin:/nix/var/nix/profiles/default/bin:${{ env.PATH }}
|
||||
run: |
|
||||
if [ -f "$HOME/.nix-profile/etc/profile.d/nix.sh" ]; then
|
||||
. "$HOME/.nix-profile/etc/profile.d/nix.sh"
|
||||
fi
|
||||
|
||||
./nixos/kubeadm/scripts/rebuild-and-bootstrap.sh
|
||||
|
||||
Reference in New Issue
Block a user