nixos/scripts/remote_switch.sh

29 lines
460 B
Bash
Raw Normal View History

2022-01-31 12:42:56 +01:00
#!/usr/bin/env bash
2022-01-31 15:45:25 +01:00
hosts=(
2022-01-31 12:42:56 +01:00
"nixos-management"
"grav"
"git"
"heimdall"
2022-02-28 14:21:34 +01:00
"jdownloader"
2022-01-31 12:42:56 +01:00
"mail"
2022-01-31 15:45:25 +01:00
"nextcloud"
"pihole"
2022-01-31 12:42:56 +01:00
"plex"
"proxy"
"rss-bridge"
"ttrss"
)
2022-01-31 15:45:25 +01:00
rsa_key="$HOME/.nixos/secrets/ssh_keys/ansible/ansible.key"
export NIX_SSHOPTS="-t -i $rsa_key"
2022-01-31 12:42:56 +01:00
2022-01-31 15:45:25 +01:00
for host in "${hosts[@]}"
do
2022-01-31 12:42:56 +01:00
fqdn="$host.2li.local"
echo $fqdn
nixos-rebuild switch --use-remote-sudo --build-host localhost --target-host $fqdn --flake ".#$host"
echo
echo
done