From c576495bb2ef132ddcec39a0a6bd2ebbddb5e3bc Mon Sep 17 00:00:00 2001 From: Yureka Date: Sat, 23 Oct 2021 00:26:39 +0200 Subject: [PATCH] update deploy script to support aarch64 --- deploy.sh | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/deploy.sh b/deploy.sh index c19b0a8..f425fce 100755 --- a/deploy.sh +++ b/deploy.sh @@ -11,12 +11,16 @@ then fi mode="${1:-switch}" -host="nuc" -target="nuc@nuc.c3h" -#host="${2:-nuc}" -#target="${3:-$host.c3h}" +host="${2:-nuc}" +target="${3:-$host.c3h}" + +echo "deploying $host to $target" +sleep 1 sources=$(nix-build nix/sources-dir.nix --no-out-link) set -x -nixos-rebuild "$mode" --target-host "$target" --use-remote-sudo -I $sources -I "nixos-config=$PWD/hosts/$host/configuration.nix" +system_drv=$(nix-instantiate "" -I $sources -I "nixos-config=$PWD/hosts/$host/configuration.nix" | head -n1) +nix-copy-closure --to $target $system_drv +system=$(ssh $target "nix-store --realise $system_drv") +ssh $target "sudo nix-env -p /nix/var/nix/profiles/system -i $system && sudo /nix/var/nix/profiles/system/bin/switch-to-configuration $mode"