1
0
Fork 0

Improve deploy script

This commit is contained in:
clerie 2020-12-20 00:05:08 +01:00
parent 389b2a2e07
commit 386523641b
1 changed files with 18 additions and 1 deletions

View File

@ -3,8 +3,25 @@
DEPLOY_HOST=$1
DEPLOY_ADDRESS=$2
if [ -z $DEPLOY_HOST ]; then
exit 1
fi
cmd=" \
nixos-rebuild switch \
-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} \
--build-host localhost \
--use-remote-sudo
--use-remote-sudo \
"
fi
eval ${cmd}