diff options
author | github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> | 2021-12-14 12:01:17 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-12-14 12:01:17 +0000 |
commit | 0242879f3fa01bdda5b7e204f963b8e6c258ad54 (patch) | |
tree | f4c5e2dfd274ea7c490c220a77d8a422e961b6f1 /pkgs/data/misc | |
parent | 4ee2a8c8058e1c9d2317345d8630c45703ff5ae8 (diff) | |
parent | d995f2abb98b92b26cc4b8044e3a3251a067757b (diff) |
Merge master into staging-next
Diffstat (limited to 'pkgs/data/misc')
-rw-r--r-- | pkgs/data/misc/v2ray-geoip/default.nix | 28 | ||||
-rwxr-xr-x | pkgs/data/misc/v2ray-geoip/update.sh | 6 |
2 files changed, 34 insertions, 0 deletions
diff --git a/pkgs/data/misc/v2ray-geoip/default.nix b/pkgs/data/misc/v2ray-geoip/default.nix new file mode 100644 index 0000000000000..7187dec537a84 --- /dev/null +++ b/pkgs/data/misc/v2ray-geoip/default.nix @@ -0,0 +1,28 @@ +{ lib, stdenv, fetchFromGitHub }: + +stdenv.mkDerivation rec { + pname = "v2ray-geoip"; + version = "202112090029"; + + src = fetchFromGitHub { + owner = "v2fly"; + repo = "geoip"; + rev = "97f4acb31d926ae31bb3cdc5c8948d8dcdddca79"; + sha256 = "sha256-kYMp/D7xVpBTu35YXq45bR2XebpVOW57UAc7H/6px/U="; + }; + + installPhase = '' + runHook preInstall + install -m 0644 geoip.dat -D $out/share/v2ray/geoip.dat + runHook postInstall + ''; + + passthru.updateScript = ./update.sh; + + meta = with lib; { + description = "GeoIP for V2Ray"; + homepage = "https://github.com/v2fly/geoip"; + license = licenses.cc-by-sa-40; + maintainers = with maintainers; [ nickcao ]; + }; +} diff --git a/pkgs/data/misc/v2ray-geoip/update.sh b/pkgs/data/misc/v2ray-geoip/update.sh new file mode 100755 index 0000000000000..e39012e30a51a --- /dev/null +++ b/pkgs/data/misc/v2ray-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 + +COMMIT=$(curl "https://api.github.com/repos/v2fly/geoip/commits/release?per_page=1") +update-source-version v2ray-geoip "$(echo $COMMIT | jq -r .commit.message)" --file=pkgs/data/misc/v2ray-geoip/default.nix --rev="$(echo $COMMIT | jq -r .sha)" |