From f3592d4dcf79015c6ed283b2376b5af44ba775ee Mon Sep 17 00:00:00 2001 From: Philip Peterson Date: Fri, 29 May 2026 22:20:38 -0800 Subject: [PATCH] updates --- bump-blog-quine.sh | 32 ++++++++++++++++++++++++++++++++ nixos/linux.nix | 2 +- nixos/system/home/shared.nix | 1 + 3 files changed, 34 insertions(+), 1 deletion(-) create mode 100755 bump-blog-quine.sh diff --git a/bump-blog-quine.sh b/bump-blog-quine.sh new file mode 100755 index 0000000..745c670 --- /dev/null +++ b/bump-blog-quine.sh @@ -0,0 +1,32 @@ +#!/usr/bin/env bash +set -euo pipefail + +LINUX=/root/petersweb-infra/nixos/linux.nix + +usage() { + echo "Usage: $0 " + echo " e.g. $0 sha256:2e2d92abae0ba68be780fff581523480ac05444690dbf38bf4330f1dda099e2a" + exit 1 +} + +[[ $# -eq 1 ]] || usage + +NEW_DIGEST="${1#sha256:}" # strip leading "sha256:" if provided + +# Validate: hex string of the right length +if ! [[ "$NEW_DIGEST" =~ ^[0-9a-f]{64}$ ]]; then + echo "Error: digest must be a 64-character lowercase hex string (got: $NEW_DIGEST)" >&2 + exit 1 +fi + +OLD_LINE=$(grep -n 'blog-quine@sha256:' "$LINUX") +echo "Current: $OLD_LINE" + +sed -i -E "s|(blog-quine@sha256:)[0-9a-f]{64}|\1${NEW_DIGEST}|" "$LINUX" + +NEW_LINE=$(grep -n 'blog-quine@sha256:' "$LINUX") +echo "Updated: $NEW_LINE" + +echo "Applying NixOS configuration..." +nixos-rebuild switch --flake /root/petersweb-infra/nixos#mainframe +echo "Done. Tail logs with: docker logs -f blog-quine" diff --git a/nixos/linux.nix b/nixos/linux.nix index 752c904..145e6c5 100644 --- a/nixos/linux.nix +++ b/nixos/linux.nix @@ -290,7 +290,7 @@ in { "blog-quine" = { autoStart = true; - image = "quineglobal/blog-quine@sha256:3c2901f772c322d81f843c04d6982b9f50ff0b46d3cc457d9f868a7ff5a15497"; + image = "quineglobal/blog-quine@sha256:a1bdd5c7efe059f9af8a6206ad3317280040e959f6bdff1cf1e4f2f27589bc25"; volumes = []; environment = {}; ports = ["3010:8080"]; diff --git a/nixos/system/home/shared.nix b/nixos/system/home/shared.nix index dfe506a..0ef0b25 100644 --- a/nixos/system/home/shared.nix +++ b/nixos/system/home/shared.nix @@ -16,6 +16,7 @@ jq killall tmux + tree unzip vim wget