clash-geoip: add update script

This commit is contained in:
Candy Cloud 2022-12-09 10:18:18 +00:00
parent f4ef149e9c
commit b32d7053fa
2 changed files with 8 additions and 0 deletions

View File

@ -18,6 +18,8 @@ stdenvNoCC.mkDerivation rec {
runHook postInstall
'';
passthru.updateScript = ./update.sh;
meta = with lib; {
description = "A GeoLite2 data created by MaxMind";
homepage = "https://github.com/Dreamacro/maxmind-geoip";

View File

@ -0,0 +1,6 @@
#! /usr/bin/env nix-shell
#! nix-shell -i bash -p common-updater-scripts curl jq
set -euo pipefail
RELEASE=$(curl "https://api.github.com/repos/Dreamacro/maxmind-geoip/releases/latest")
update-source-version clash-geoip "$(echo $RELEASE | jq -r .tag_name)"