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
|
- name: Validate nix installation
|
||||||
run: |
|
run: |
|
||||||
if [ ! -x /nix/var/nix/profiles/default/bin/nix ]; then
|
if [ -x /nix/var/nix/profiles/default/bin/nix ]; then
|
||||||
echo "Nix not found at /nix/var/nix/profiles/default/bin/nix"
|
/nix/var/nix/profiles/default/bin/nix --version
|
||||||
exit 1
|
exit 0
|
||||||
fi
|
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
|
- name: Run cluster rebuild and bootstrap
|
||||||
env:
|
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: |
|
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
|
./nixos/kubeadm/scripts/rebuild-and-bootstrap.sh
|
||||||
|
|||||||
Reference in New Issue
Block a user