From f4ef149e9c529e929c1b039dea0f26ab0c79a823 Mon Sep 17 00:00:00 2001 From: Candy Cloud Date: Fri, 9 Dec 2022 10:09:06 +0000 Subject: [PATCH 1/5] clash-geoip: 20220912 -> 20221112 --- pkgs/data/misc/clash-geoip/default.nix | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/pkgs/data/misc/clash-geoip/default.nix b/pkgs/data/misc/clash-geoip/default.nix index 31d7384976d6..6ebded41f09f 100644 --- a/pkgs/data/misc/clash-geoip/default.nix +++ b/pkgs/data/misc/clash-geoip/default.nix @@ -1,20 +1,20 @@ -{ lib, stdenv, fetchurl }: +{ lib, stdenvNoCC, fetchurl }: -stdenv.mkDerivation rec { +stdenvNoCC.mkDerivation rec { pname = "clash-geoip"; - version = "20220912"; + version = "20221112"; - src = ./.; - - data = fetchurl { + src = fetchurl { url = "https://github.com/Dreamacro/maxmind-geoip/releases/download/${version}/Country.mmdb"; sha256 = "sha256-YIQjuWbizheEE9kgL+hBS1GAGf2PbpaW5mu/lim9Q9A"; }; + dontUnpack = true; + installPhase = '' runHook preInstall mkdir -p $out/etc/clash - install -Dm 0644 $data -D $out/etc/clash/Country.mmdb + install -Dm 0644 $src -D $out/etc/clash/Country.mmdb runHook postInstall ''; From b32d7053fa6155897b4b6aa113c2f96f066114f2 Mon Sep 17 00:00:00 2001 From: Candy Cloud Date: Fri, 9 Dec 2022 10:18:18 +0000 Subject: [PATCH 2/5] clash-geoip: add update script --- pkgs/data/misc/clash-geoip/default.nix | 2 ++ pkgs/data/misc/clash-geoip/update.sh | 6 ++++++ 2 files changed, 8 insertions(+) create mode 100755 pkgs/data/misc/clash-geoip/update.sh diff --git a/pkgs/data/misc/clash-geoip/default.nix b/pkgs/data/misc/clash-geoip/default.nix index 6ebded41f09f..3c1fad47b06c 100644 --- a/pkgs/data/misc/clash-geoip/default.nix +++ b/pkgs/data/misc/clash-geoip/default.nix @@ -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"; diff --git a/pkgs/data/misc/clash-geoip/update.sh b/pkgs/data/misc/clash-geoip/update.sh new file mode 100755 index 000000000000..f4d5edcd5ca8 --- /dev/null +++ b/pkgs/data/misc/clash-geoip/update.sh @@ -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)" From 231da669c35e6e22f21a95e0a9ae60378e274050 Mon Sep 17 00:00:00 2001 From: Candy Cloud Date: Fri, 16 Dec 2022 09:17:01 +0000 Subject: [PATCH 3/5] clash-geoip: 20221112 -> 20221212 --- pkgs/data/misc/clash-geoip/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/data/misc/clash-geoip/default.nix b/pkgs/data/misc/clash-geoip/default.nix index 3c1fad47b06c..f98e286bb2e0 100644 --- a/pkgs/data/misc/clash-geoip/default.nix +++ b/pkgs/data/misc/clash-geoip/default.nix @@ -2,11 +2,11 @@ stdenvNoCC.mkDerivation rec { pname = "clash-geoip"; - version = "20221112"; + version = "20221212"; src = fetchurl { url = "https://github.com/Dreamacro/maxmind-geoip/releases/download/${version}/Country.mmdb"; - sha256 = "sha256-YIQjuWbizheEE9kgL+hBS1GAGf2PbpaW5mu/lim9Q9A"; + sha256 = "sha256-pApPPRIvG8qak5chupTN2u1IUKANXtkcEMlSAPedjH4="; }; dontUnpack = true; From 62fa8fe959b53d021fe549e0b6665aab5d40a48d Mon Sep 17 00:00:00 2001 From: Candy Cloud Date: Sat, 17 Dec 2022 17:23:52 +0800 Subject: [PATCH 4/5] clash-geoip: use new update script --- pkgs/data/misc/clash-geoip/default.nix | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/pkgs/data/misc/clash-geoip/default.nix b/pkgs/data/misc/clash-geoip/default.nix index f98e286bb2e0..8c9a288b6c6a 100644 --- a/pkgs/data/misc/clash-geoip/default.nix +++ b/pkgs/data/misc/clash-geoip/default.nix @@ -1,4 +1,4 @@ -{ lib, stdenvNoCC, fetchurl }: +{ lib, stdenvNoCC, fetchurl, nix-update-script }: stdenvNoCC.mkDerivation rec { pname = "clash-geoip"; @@ -18,7 +18,11 @@ stdenvNoCC.mkDerivation rec { runHook postInstall ''; - passthru.updateScript = ./update.sh; + passthru = { + updateScript = nix-update-script { + attrPath = pname; + }; + }; meta = with lib; { description = "A GeoLite2 data created by MaxMind"; From c8c93b4d62064668f05291f129d8f09e020d578a Mon Sep 17 00:00:00 2001 From: Candy Cloud Date: Sat, 17 Dec 2022 17:24:35 +0800 Subject: [PATCH 5/5] clash-geoip: remove old update script --- pkgs/data/misc/clash-geoip/update.sh | 6 ------ 1 file changed, 6 deletions(-) delete mode 100755 pkgs/data/misc/clash-geoip/update.sh diff --git a/pkgs/data/misc/clash-geoip/update.sh b/pkgs/data/misc/clash-geoip/update.sh deleted file mode 100755 index f4d5edcd5ca8..000000000000 --- a/pkgs/data/misc/clash-geoip/update.sh +++ /dev/null @@ -1,6 +0,0 @@ -#! /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)"