diff --git a/scripts/remote_switch.sh b/scripts/remote_switch.sh index 14ed4a4..4c93516 100755 --- a/scripts/remote_switch.sh +++ b/scripts/remote_switch.sh @@ -1,15 +1,10 @@ #!/usr/bin/env bash -hosts=( - "mail" - "nextcloud" - "plex" - "management" - "restic-server" - "ttrss" - "git" - "proxy" - "pihole" +hosts=($(echo `nix eval .#nixosConfigurations --apply 'pkgs: builtins.concatStringsSep " " (builtins.attrNames pkgs)'` | xargs )) +skip=( + "gwyn" + "loki-test" + "desktop-vm" ) rsa_key="$HOME/.nixos/secrets/ssh_keys/ansible/ansible.key" @@ -17,6 +12,10 @@ export NIX_SSHOPTS="-t -i $rsa_key" for host in "${hosts[@]}" do + # Check if the host is in the skip list + if [[ " ${skip[*]} " =~ " ${host} " ]];then + continue + fi fqdn="$host.2li.local" echo $fqdn nixos-rebuild switch -j auto --use-remote-sudo --build-host localhost --target-host $fqdn --flake ".#$host"