Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save srghma/aafd28305441e5e643be2855ef17e373 to your computer and use it in GitHub Desktop.
Save srghma/aafd28305441e5e643be2855ef17e373 to your computer and use it in GitHub Desktop.
stage_ssh () {
ssh \
root@${stage_ip} \
-i ${toString ../secrets/stage_root_key} \
$@
}
state_nixos_rebuild () {
NIX_SSHOPTS="-i ${toString ../secrets/stage_root_key}" \
nixos-rebuild \
--fast \
-I nixos-config=${toString ../machines/stage} \
$@
}
stage_deploy () {
state_nixos_rebuild --target-host root@${stage_ip} switch
}
stage_test () {
state_nixos_rebuild build
}
stage_deploy_until_succeed () {
until stage_deploy
do
echo "Trying again"
done
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment