This repository has no description
0

Configure Feed

Select the types of activity you want to include in your feed.

tools.worldview: 8fc39cf -> f325daa (0-unstable-2026-05-03), add updateScript

+53 -3
+9 -3
tools/worldview/flake-module.nix
··· 3 3 perSystem = 4 4 { pkgs, ... }: 5 5 let 6 + version = "0-unstable-2026-05-03"; 7 + rev = "f325daad229bb15f6a1d1d3d1e9f76a744d2b2c4"; 6 8 src = pkgs.fetchFromGitHub { 7 9 owner = "audibleblink"; 8 10 repo = "worldview"; 9 - rev = "8fc39cf28d2334d4902bc552ec4a18f3c746af20"; 10 - hash = "sha256-effKF2cxG6r5Aw4DT6ZuJzbpRCBeFTQS3wxdh57AHEI="; 11 + inherit rev; 12 + hash = "sha256-L18lWcK5gEEiLyYSETk3+7KacBjxpr4SwrolcWXu4sc="; 11 13 }; 12 14 in 13 15 { 14 16 packages.worldview = pkgs.writeShellApplication { 15 17 name = "worldview"; 18 + passthru = { 19 + inherit version; 20 + updateScript = ./update.sh; 21 + }; 16 22 runtimeInputs = [ 17 23 pkgs.bun 18 24 pkgs.ungoogled-chromium ··· 41 47 42 48 # Copy source if not yet present or if version changed 43 49 MARKER="$WORKDIR/.version" 44 - CURRENT_REV="8fc39cf28d2334d4902bc552ec4a18f3c746af20" 50 + CURRENT_REV="${rev}" 45 51 if [ ! -f "$MARKER" ] || [ "$(cat "$MARKER")" != "$CURRENT_REV" ]; then 46 52 echo "Setting up worldview source..." 47 53 rm -rf "$WORKDIR/src"
+44
tools/worldview/update.sh
··· 1 + #!/usr/bin/env bash 2 + set -euo pipefail 3 + 4 + # Tracks the default branch (dev) of audibleblink/worldview. 5 + # nix-update can't edit this flake-module.nix (no package.nix / meta.position). 6 + owner=audibleblink 7 + repo=worldview 8 + attr=worldview 9 + 10 + # Run by update-pkgs from the flake root ($0 is a read-only store copy). 11 + file=tools/worldview/flake-module.nix 12 + # Depends on ungoogled-chromium, which only evaluates on Linux. 13 + system=x86_64-linux 14 + 15 + commit=$(curl -fsSL "https://api.github.com/repos/$owner/$repo/commits/HEAD") 16 + new_rev=$(jq -r .sha <<<"$commit") 17 + new_date=$(jq -r .commit.committer.date <<<"$commit" | cut -d T -f1) 18 + new_version="0-unstable-$new_date" 19 + old_rev=$(sed -n 's/^ *rev = "\([0-9a-f]*\)";/\1/p' "$file") 20 + if [ "$old_rev" = "$new_rev" ]; then 21 + echo "$attr: already up to date ($new_rev)" 22 + exit 0 23 + fi 24 + 25 + # Blank the hash: with the old one nix reuses the cached FOD (old source). 26 + sed -i \ 27 + -e "s|^\( *\)rev = \"[0-9a-f]*\";|\1rev = \"$new_rev\";|" \ 28 + -e "s|^\( *\)version = \"[^\"]*\";|\1version = \"$new_version\";|" \ 29 + -e "s|^\( *\)hash = \"[^\"]*\";|\1hash = \"\";|" \ 30 + "$file" 31 + 32 + build_attr=".#packages.$system.$attr" 33 + 34 + # Probe build is expected to fail with a hash mismatch. 35 + got=$({ nix build --no-link "$build_attr" 2>&1 || true; } | tee /dev/stderr \ 36 + | awk '/got:/ && !seen { print $2; seen = 1 }' || true) 37 + if [ -z "$got" ]; then 38 + echo "$attr: failed to determine src hash" >&2 39 + exit 1 40 + fi 41 + sed -i "s|^\( *\)hash = \"\";|\1hash = \"$got\";|" "$file" 42 + 43 + echo "$attr: updated $old_rev -> $new_rev ($new_version)" 44 + nix build --no-link "$build_attr"