From e87bc1114ce1d491b4e9953a7503a7894ff2f5f8 Mon Sep 17 00:00:00 2001 From: 0xTux <0xtux@pm.me> Date: Sat, 3 Aug 2024 17:08:44 +0530 Subject: [PATCH] add deploy script to build host remotely --- deploy.sh | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100755 deploy.sh diff --git a/deploy.sh b/deploy.sh new file mode 100755 index 0000000..1254478 --- /dev/null +++ b/deploy.sh @@ -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