diff --git a/deploy.sh b/deploy.sh index 8ae9f8d..e42623a 100755 --- a/deploy.sh +++ b/deploy.sh @@ -2,6 +2,7 @@ DEPLOY_HOST=$1 DEPLOY_ADDRESS=$2 +DEPLOY_PORT=$3 if [ -z $DEPLOY_HOST ]; then exit 1 @@ -12,7 +13,7 @@ nixos-rebuild switch \ -I nixos-config=hosts/${DEPLOY_HOST}/configuration.nix \ " -if [ -z $DEPLOY_ADDRESS ]; then +if [ -z $DEPLOY_ADDRESS ] || [ $DEPLOY_ADDRESS = "-" ]; then DEPLOY_ADDRESS="clerie@${DEPLOY_HOST}.net.clerie.de" fi @@ -24,4 +25,8 @@ if [ $DEPLOY_ADDRESS != "localhost" ]; then " fi +if [ -n "$DEPLOY_PORT" ]; then + cmd="NIX_SSHOPTS=\"-p $DEPLOY_PORT\" ${cmd}" +fi + eval ${cmd}