mirror of
https://github.com/tuxdotrs/nixos-config.git
synced 2025-07-06 17:56:35 +05:30
16 lines
382 B
Bash
Executable File
16 lines
382 B
Bash
Executable File
#!/usr/bin/env bash
|
|
export NIX_SSHOPTS="-A"
|
|
|
|
hostname=$(hostname)
|
|
target_hosts="$1"
|
|
shift
|
|
|
|
if [ -z "$target_hosts" ]; then
|
|
echo "No hosts to deploy"
|
|
exit 2
|
|
fi
|
|
|
|
for target_host in ${target_hosts//,/ }; do
|
|
nixos-rebuild switch --flake .#$target_host --target-host $target_host --build-host $hostname --use-remote-sudo --use-substitutes --log-format internal-json -v $@
|
|
done
|