diff --git a/deploy-flake.sh b/deploy-flake.sh index 45eeb99c..b7679da2 100755 --- a/deploy-flake.sh +++ b/deploy-flake.sh @@ -26,7 +26,10 @@ while [[ $# -gt 0 ]]; do build_local=true ;; *) - target=$1 + # strip hostname and user + host=$1 + target=${1//.hq.c3d2.de/} + target=${target//.c3d2.de/} ;; esac shift @@ -35,8 +38,8 @@ done if [[ -v build_local ]]; then nix --experimental-features 'nix-command flakes' -Lv build ".#nixosConfigurations.$target.config.system.build.toplevel" store_path=$(readlink -f result) - nix-copy-closure --to root@"$target" -v "$store_path" - ssh root@"$target" "$store_path/bin/switch-to-configuration" switch + nix-copy-closure --to root@"$host" -v "$store_path" + ssh root@"$host" "$store_path/bin/switch-to-configuration" switch else hostname=$(echo "$target" | cut -d . -f 1)