add deploy script to build host remotely

This commit is contained in:
2024-08-03 17:08:44 +05:30
parent a71bf5425e
commit e87bc1114c

16
deploy.sh Executable file
View File

@ -0,0 +1,16 @@
#!/usr/bin/env bash
export NIX_SSHOPTS="-A"
build_remote=false
hosts="$1"
shift
if [ -z "$hosts" ]; then
echo "No hosts to deploy"
exit 2
fi
for host in ${hosts//,/ }; do
nixos-rebuild --flake .\#$host switch --target-host $host --use-remote-sudo --use-substitutes $@
done