jungle/rebuild.sh

17 lines
352 B
Bash
Raw Permalink Normal View History

2023-06-16 12:13:07 +02:00
#!/bin/sh -ex
2023-04-26 14:09:23 +02:00
if [ "$(id -u)" != 0 ]; then
echo "Needs root permissions"
exit 1
fi
2023-06-16 12:13:07 +02:00
if [ "$(hostname)" != "hut" ]; then
>&2 echo "must run from machine hut, not $(hostname)"
exit 1
fi
2023-04-26 14:09:23 +02:00
2023-06-16 12:13:07 +02:00
# Update all nodes
2023-04-26 17:36:36 +02:00
nixos-rebuild switch --flake .
2023-06-16 12:13:07 +02:00
nixos-rebuild switch --flake .#owl1 --target-host owl1
nixos-rebuild switch --flake .#owl2 --target-host owl2