2023-06-03 14:36:35 +00:00
|
|
|
{ lib
|
|
|
|
, stdenvNoCC
|
|
|
|
, fetchurl
|
|
|
|
}:
|
|
|
|
|
2023-08-01 06:34:17 +00:00
|
|
|
stdenvNoCC.mkDerivation (finalAttrs: {
|
2023-06-03 14:36:35 +00:00
|
|
|
pname = "dbip-country-lite";
|
2023-10-01 15:34:50 +00:00
|
|
|
version = "2023-10";
|
2023-06-03 14:36:35 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
2023-08-01 06:34:17 +00:00
|
|
|
url = "https://download.db-ip.com/free/dbip-country-lite-${finalAttrs.version}.mmdb.gz";
|
2023-10-01 15:34:50 +00:00
|
|
|
hash = "sha256-PQn8dyx4l3r7N52rv/Woth6J61+WvVL+SHKMkVVtFsw=";
|
2023-06-03 14:36:35 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
dontUnpack = true;
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
runHook preBuild
|
|
|
|
|
|
|
|
gzip -c -d "$src" > dbip-country-lite.mmdb
|
|
|
|
install -Dm444 dbip-country-lite.mmdb "$out/share/dbip/dbip-country-lite.mmdb"
|
|
|
|
|
|
|
|
runHook postBuild
|
|
|
|
'';
|
|
|
|
|
2023-08-01 06:34:17 +00:00
|
|
|
passthru.mmdb = "${finalAttrs.finalPackage}/share/dbip/dbip-country-lite.mmdb";
|
2023-06-03 14:36:35 +00:00
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "The free IP to Country Lite database by DB-IP";
|
|
|
|
homepage = "https://db-ip.com/db/download/ip-to-country-lite";
|
|
|
|
license = licenses.cc-by-40;
|
|
|
|
maintainers = with maintainers; [ nickcao ];
|
|
|
|
platforms = platforms.all;
|
|
|
|
};
|
2023-08-01 06:34:17 +00:00
|
|
|
})
|