forked from Yuka/c3h-nixfiles
update deploy script to support aarch64
This commit is contained in:
parent
e2efc79686
commit
c576495bb2
1 changed files with 9 additions and 5 deletions
14
deploy.sh
14
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 "<nixpkgs/nixos>" -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"
|
||||
|
|
Loading…
Reference in a new issue