1554768917
* feat: add * hack * feat: add secrets pre-commit * wip * wip * hacking at gatus * hacking at gatus * wip * wip * hack * hack * hack * hack * feat: gatus doing gatus stuff * hack * guh * hacking * hack * hack * hack * feat: add helios * hack * chore: new hosts reencrypt * Auto lint/format --------- Co-authored-by: Truxnell <9149206+truxnell@users.noreply.github.com> Co-authored-by: truxnell <truxnell@users.noreply.github.com>
37 lines
837 B
Bash
Executable file
37 lines
837 B
Bash
Executable file
#!/usr/bin/env bash
|
|
|
|
set -e
|
|
|
|
hosts=($(echo $(nix eval .#nixosConfigurations --apply 'pkgs: builtins.concatStringsSep " " (builtins.attrNames pkgs)') | xargs))
|
|
skip=(
|
|
"citadel"
|
|
"rickenbacker"
|
|
)
|
|
|
|
reboot=0
|
|
|
|
while getopts ":r" option; do
|
|
case $option in
|
|
r)
|
|
reboot=1
|
|
;;
|
|
esac
|
|
done
|
|
|
|
for host in "${hosts[@]}"; do
|
|
# Check if the host is in the skip list
|
|
if [[ " ${skip[*]} " =~ " ${host} " ]]; then
|
|
continue
|
|
fi
|
|
fqdn="$host.l.trux.dev"
|
|
if [ $reboot -eq 0 ]; then
|
|
echo $fqdn
|
|
nixos-rebuild switch -j auto --use-remote-sudo --target-host $fqdn --flake ".#$host"
|
|
else
|
|
echo "$fqdn with reboot"
|
|
nixos-rebuild boot -j auto --use-remote-sudo --target-host $fqdn --flake ".#$host"
|
|
ssh -i $rsa_key $fqdn 'sudo reboot'
|
|
fi
|
|
echo
|
|
echo
|
|
done
|