1
0

Improve deploy script

This commit is contained in:
clerie 2020-12-20 00:05:08 +01:00
parent 389b2a2e07
commit 386523641b

View File

@ -3,8 +3,25 @@
DEPLOY_HOST=$1 DEPLOY_HOST=$1
DEPLOY_ADDRESS=$2 DEPLOY_ADDRESS=$2
if [ -z $DEPLOY_HOST ]; then
exit 1
fi
cmd=" \
nixos-rebuild switch \ nixos-rebuild switch \
-I nixos-config=hosts/${DEPLOY_HOST}/configuration.nix \ -I nixos-config=hosts/${DEPLOY_HOST}/configuration.nix \
"
if [ -z $DEPLOY_ADDRESS ]; then
DEPLOY_ADDRESS="clerie@${DEPLOY_HOST}.net.clerie.de"
fi
if [ $DEPLOY_ADDRESS != "localhost" ]; then
cmd="${cmd} \
--target-host ${DEPLOY_ADDRESS} \ --target-host ${DEPLOY_ADDRESS} \
--build-host localhost \ --build-host localhost \
--use-remote-sudo --use-remote-sudo \
"
fi
eval ${cmd}