Skip to content

Commit

Permalink
run-guix-workstation: Include rerun scripts.
Browse files Browse the repository at this point in the history
  • Loading branch information
wigust committed Dec 2, 2024
1 parent 9361d51 commit dc17c7c
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 51 deletions.
18 changes: 0 additions & 18 deletions rerun.2.sh

This file was deleted.

29 changes: 0 additions & 29 deletions rerun.sh

This file was deleted.

45 changes: 41 additions & 4 deletions run-guix-workstation.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,32 @@

set -o nounset -o errexit -o pipefail

/home/oleg/.local/share/chezmoi/rerun.sh
if kubectl -n workstation delete --wait=false pod/workstation
then
:
fi

check()
{
if ssh 192.168.0.192 sudo nerdctl -n k8s.io ps | grep --quiet workstation
then
return 1
else
if kubectl -n workstation delete --force pod/workstation
then
:
fi
fi
}

until check
do
sleep 2
done

cd /home/oleg/.local/share/chezmoi/apps/cluster1/workstation || exit 1
flux reconcile kustomization workstation

ssh 192.168.0.192 <<'EOF'
PATH="/home/oleg/.guix-profile/bin:/gnu/store/3q2x34wg1fff833wwzxnagnv7vbfxb0w-jc-1.25.2/bin:$PATH"
export PATH
Expand All @@ -23,7 +48,19 @@ sleep 10
sudo /root/run.py
sleep 1
sudo /root/run.py
EOF
echo "INFO: Waiting Guix workstation container to start for 10 seconds." 1>&2
sleep 10
/home/oleg/.local/share/chezmoi/rerun.2.sh
bar()
{
if sudo /home/oleg/bin/nerdctl-guix-exec /bin/sh -lc 'export SWAYSOCK="$(echo /run/user/1000/sway-ipc*sock)"; /home/oleg/.guix-home/profile/bin/swaymsg -t get_outputs'
then
sudo herd restart container-guix-sway-autostart
exit 0
fi
}
until bar
do
sleep 2
done
EOF

0 comments on commit dc17c7c

Please sign in to comment.