From 38ccadbc876ab9ae4f27d3e84a31f57bee10af3b Mon Sep 17 00:00:00 2001 From: Akshay Nair Date: Sun, 8 Jun 2025 21:05:21 +0530 Subject: Switch to ssh key --- build.sh | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'build.sh') diff --git a/build.sh b/build.sh index 0d6376f..0d8d65b 100755 --- a/build.sh +++ b/build.sh @@ -4,14 +4,17 @@ set -euo pipefail SSH_TARGET="bacchus@192.168.0.117" config_sync() { - sshpass -p password rsync -r "$SSH_TARGET:~/nixos/flake.lock" . - sshpass -p password rsync -r . "$SSH_TARGET:~/nixos" - # sshpass -p password ssh "$SSH_TARGET" sh -c "nixos-rebuild build --flake 'path:/home/bacchus/nixos#bacchus'" + rsync -r "$SSH_TARGET:~/nixos/flake.lock" . + rsync -r . "$SSH_TARGET:~/nixos" + # ssh "$SSH_TARGET" sh -c "nixos-rebuild build --flake 'path:/home/bacchus/nixos#bacchus'" } +run_ssh() { ssh "$SSH_TARGET" "$@"; } + cmd="$1"; shift; case "$cmd" in sync) config_sync ;; + run) run_ssh "$@" ;; *) echo "foo" && exit 1 ;; esac -- cgit v1.3.1