From 025888c4501e668b5ea4cde02b0d536e960dab2f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= Date: Wed, 19 Jul 2023 11:29:29 +0200 Subject: [PATCH] add deploy.sh script --- targets/web01/deploy.sh | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100755 targets/web01/deploy.sh diff --git a/targets/web01/deploy.sh b/targets/web01/deploy.sh new file mode 100755 index 0000000..3f47464 --- /dev/null +++ b/targets/web01/deploy.sh @@ -0,0 +1,14 @@ +#!/usr/bin/env nix-shell +#!nix-shell -i bash -p nix jq bash rsync + +set -euo pipefail + +path=$(nix flake metadata --json '.#' | jq -r .path) +ip=65.109.103.5 +rsync --checksum -vaF --delete -e ssh "${path}/" "root@${ip}:/etc/nixos" + +ssh "root@$ip" nixos-rebuild switch \ + --fast \ + --option keep-going true \ + --option accept-flake-config true \ + --flake '/etc/nixos#web01'