From 47b1ceba7991be1a65319b509db4eff3e9a77038 Mon Sep 17 00:00:00 2001 From: Giulio De Pasquale Date: Fri, 18 Apr 2025 16:45:24 +0100 Subject: [PATCH] feat: added update hashes script --- update_cached_hashes.sh | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100755 update_cached_hashes.sh diff --git a/update_cached_hashes.sh b/update_cached_hashes.sh new file mode 100755 index 0000000..f468c5d --- /dev/null +++ b/update_cached_hashes.sh @@ -0,0 +1,14 @@ +#!/usr/bin/env bash + +# this guy updates the hash of the last +# successful build of nixpkgs on hydra +# (so we don't have to rebuild EVERYTHING) +RELEASE=24.11 + +new=$(curl -sL "https://monitoring.nixos.org/prometheus/api/v1/query?query=channel_revision" | jq -r ".data.result[] | select(.metric.channel==\"nixos-${RELEASE}\") | .metric.revision") +old=$(jq -r ".nodes.nixpkgs.locked.rev" flake.lock) + +echo "Old hash: ${old}" +echo "New hash: ${new}" + +sed -i s/"${old}"/"${new}"/ flake.nix