From 0284bbd6759cfc779c133dce2a1a512771ecfc64 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sandro=20J=C3=A4ckel?= Date: Mon, 25 Oct 2021 01:06:27 +0200 Subject: [PATCH] Remove due to easy miss use which can overwrite the public access proxy --- deploy-flake.sh | 55 ------------------------------------------------- 1 file changed, 55 deletions(-) delete mode 100755 deploy-flake.sh diff --git a/deploy-flake.sh b/deploy-flake.sh deleted file mode 100755 index 3913f10f..00000000 --- a/deploy-flake.sh +++ /dev/null @@ -1,55 +0,0 @@ -#! /usr/bin/env nix-shell -#! nix-shell -i bash -p rsync - -# shellcheck shell=bash - -set -eou pipefail - -function show_help() { - echo "Usage:" - echo "$0 [--build-local] " - echo "--help Show this help." - echo "--build-local Build config locally and copy it to the target system via nix copy" - exit 1 -} - -if [[ $# == 0 ]]; then - show_help -fi - -while [[ $# -gt 0 ]]; do - case "${1:-}" in - "" | "-h" | "--help") - show_help - ;; - "--build-local") - build_local=true - ;; - *) - # strip hostname and user - host=$1 - target=${1//.hq.c3d2.de/} - target=${target//.c3d2.de/} - - if [[ $target == keycloak ]]; then - echo "Deploying keycloak like this is a bad idea because the ssh connection ends up in the gitea container!" - exit 1 - fi - ;; - esac - shift -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 --experimental-features 'nix-command flakes' copy --to ssh://root@"$host" -v "$store_path" - ssh root@"$host" "$store_path/bin/switch-to-configuration" switch -else - hostname=$(echo "$target" | cut -d . -f 1) - - rsync -az "$(dirname "$0")" root@"$target":nix-config - - echo "$hostname> nixos-rebuild switch" - exec ssh root@"$target" "nixos-rebuild --flake ./nix-config#$hostname switch" -fi