summary refs log tree commit diff
path: root/pkgs/data
diff options
context:
space:
mode:
authorgithub-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>2021-12-15 00:08:01 +0000
committerGitHub <noreply@github.com>2021-12-15 00:08:01 +0000
commitd3da112c8ccdc16615cdc1aa275a5d75482e2b9e (patch)
treed3ab45940358d5fb62d1a1d58e2099aaacac238e /pkgs/data
parent7e9d55f0c4fbbf73f885d55035ed6bad1361f091 (diff)
parentf2d205ca02d34fbf4a125f74f3205634b1cbcedc (diff)
downloadnixpkgs-d3da112c8ccdc16615cdc1aa275a5d75482e2b9e.tar
nixpkgs-d3da112c8ccdc16615cdc1aa275a5d75482e2b9e.tar.gz
nixpkgs-d3da112c8ccdc16615cdc1aa275a5d75482e2b9e.tar.bz2
nixpkgs-d3da112c8ccdc16615cdc1aa275a5d75482e2b9e.tar.lz
nixpkgs-d3da112c8ccdc16615cdc1aa275a5d75482e2b9e.tar.xz
nixpkgs-d3da112c8ccdc16615cdc1aa275a5d75482e2b9e.tar.zst
nixpkgs-d3da112c8ccdc16615cdc1aa275a5d75482e2b9e.zip
Merge master into haskell-updates
Diffstat (limited to 'pkgs/data')
-rw-r--r--pkgs/data/misc/v2ray-geoip/default.nix28
-rwxr-xr-xpkgs/data/misc/v2ray-geoip/update.sh6
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 00000000000..7187dec537a
--- /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 00000000000..e39012e30a5
--- /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)"