add deploy.sh script

This commit is contained in:
Jörg Thalheim 2023-07-19 11:29:29 +02:00
parent a34b168bee
commit 025888c450

14
targets/web01/deploy.sh Executable file
View File

@ -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'