nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1#!/usr/bin/env nix-shell
2#!nix-shell -i bash -p curl xq-xml common-updater-scripts
3
4set -eu
5
6ROOT="$(dirname "$(readlink -f "$0")")"
7NIX_DRV="$ROOT/package.nix"
8if [ ! -f "$NIX_DRV" ]; then
9 echo "ERROR: cannot find package.nix in $ROOT"
10 exit 1
11fi
12
13LATEST_VERSION="$(curl -Ls https://www.mowglii.com/itsycal/versionhistory.html | xq -m -q 'h4' -a 'id' | head -n1)"
14
15if [ -z "$LATEST_VERSION" ]; then
16 echo "ERROR: Failed to scrape the latest version."
17 exit 1
18fi
19
20update-source-version itsycal "$LATEST_VERSION" --file="$NIX_DRV"