From 7f4c41bb328b942af172a4ed160721f75056d0a0 Mon Sep 17 00:00:00 2001 From: Tom Alexander Date: Sun, 4 May 2025 15:16:44 -0400 Subject: [PATCH] Add odo deploy scripts. --- nix/configuration/hosts/odo/DEPLOY_BOOT | 19 +++++++++++++++++++ nix/configuration/hosts/odo/DEPLOY_SWITCH | 19 +++++++++++++++++++ nix/configuration/hosts/quark/DEPLOY_BOOT | 4 ++-- 3 files changed, 40 insertions(+), 2 deletions(-) create mode 100755 nix/configuration/hosts/odo/DEPLOY_BOOT create mode 100755 nix/configuration/hosts/odo/DEPLOY_SWITCH diff --git a/nix/configuration/hosts/odo/DEPLOY_BOOT b/nix/configuration/hosts/odo/DEPLOY_BOOT new file mode 100755 index 0000000..f23cf46 --- /dev/null +++ b/nix/configuration/hosts/odo/DEPLOY_BOOT @@ -0,0 +1,19 @@ +#!/usr/bin/env bash +# +set -euo pipefail +IFS=$'\n\t' +DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" + +: "${JOBS:="1"}" + +# TARGET=10.216.1.15 +# TARGET=192.168.211.250 +TARGET=odo + +nix flake update zsh-histdb --flake "$DIR/../../" +nix flake update ansible-sshjail --flake "$DIR/../../" +for f in /persist/manual/manual_add_to_store/*; do nix-store --add-fixed sha256 "$f"; done + +nixos-rebuild boot --flake "$DIR/../../#odo" --target-host "$TARGET" --build-host "$TARGET" --fast --use-remote-sudo --max-jobs "$JOBS" "${@}" |& nom + +# rsync -av --progress --delete --exclude=.git "$DIR/../../../configuration" "talexander@${TARGET}:/persist/manual/" && ssh talexander@${TARGET} 'cd /persist/manual/configuration && nix flake update zsh-histdb && nix flake update ansible-sshjail && doas nice -n 19 nixos-rebuild boot --flake /persist/manual/configuration#odo' diff --git a/nix/configuration/hosts/odo/DEPLOY_SWITCH b/nix/configuration/hosts/odo/DEPLOY_SWITCH new file mode 100755 index 0000000..ff72161 --- /dev/null +++ b/nix/configuration/hosts/odo/DEPLOY_SWITCH @@ -0,0 +1,19 @@ +#!/usr/bin/env bash +# +set -euo pipefail +IFS=$'\n\t' +DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" + +: "${JOBS:="1"}" + +#TARGET=10.216.1.14 +# TARGET=192.168.211.250 +TARGET=odo + +nix flake update zsh-histdb --flake "$DIR/../../" +nix flake update ansible-sshjail --flake "$DIR/../../" +for f in /persist/manual/manual_add_to_store/*; do nix-store --add-fixed sha256 "$f"; done + +nixos-rebuild switch --flake "$DIR/../../#odo" --target-host "$TARGET" --build-host "$TARGET" --fast --use-remote-sudo --max-jobs "$JOBS" "${@}" |& nom + +# rsync -av --progress --delete --exclude=.git "$DIR/../../../configuration" "talexander@${TARGET}:/persist/manual/" && ssh talexander@${TARGET} 'cd /persist/manual/configuration && nix flake update zsh-histdb && nix flake update ansible-sshjail && doas nice -n 19 nixos-rebuild switch --flake /persist/manual/configuration#odo' diff --git a/nix/configuration/hosts/quark/DEPLOY_BOOT b/nix/configuration/hosts/quark/DEPLOY_BOOT index da18d05..50ae372 100755 --- a/nix/configuration/hosts/quark/DEPLOY_BOOT +++ b/nix/configuration/hosts/quark/DEPLOY_BOOT @@ -6,9 +6,9 @@ DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" : "${JOBS:="1"}" -TARGET=10.216.1.15 +#TARGET=10.216.1.15 # TARGET=192.168.211.250 -#TARGET=quark +TARGET=quark nix flake update zsh-histdb --flake "$DIR/../../" nix flake update ansible-sshjail --flake "$DIR/../../"