42 lines
1.3 KiB
Nix
42 lines
1.3 KiB
Nix
{ stdenv, fetchurl }:
|
|
|
|
let
|
|
fetchDB = src: name: sha256: fetchurl {
|
|
inherit name sha256;
|
|
url = "https://geolite.maxmind.com/download/geoip/database/${src}";
|
|
};
|
|
in
|
|
stdenv.mkDerivation rec {
|
|
name = "geolite-legacy-${version}";
|
|
version = "2016-07-04";
|
|
|
|
srcGeoIP = fetchDB
|
|
"GeoLiteCountry/GeoIP.dat.gz" "GeoIP.dat.gz"
|
|
"1msm12a6m7rszvdbfldaq3d2hpq0rmpb0af678xwk1m6ff1rinm6";
|
|
srcGeoIPv6 = fetchDB
|
|
"GeoIPv6.dat.gz" "GeoIPv6.dat.gz"
|
|
"0sjh77cawlv5jix148r0kg5hy5xymgwsw1lf02dhn1mwqy9k4j9p";
|
|
srcGeoLiteCity = fetchDB
|
|
"GeoLiteCity.dat.xz" "GeoIPCity.dat.xz"
|
|
"02g7qhjk1mh4gnplyry3nashkl3whlr4mv1lr56fh7qmi2fhjpk3";
|
|
srcGeoLiteCityv6 = fetchDB
|
|
"GeoLiteCityv6-beta/GeoLiteCityv6.dat.gz" "GeoIPCityv6.dat.gz"
|
|
"0dq5rh08xgwsrmkniww001b2dpd1d7db4sd385p70hkbbry496l3";
|
|
srcGeoIPASNum = fetchDB
|
|
"asnum/GeoIPASNum.dat.gz" "GeoIPASNum.dat.gz"
|
|
"168z6j6adrn80sl3ip41fa0jfv2p26lfa8qil6w17sqhg8f61rnp";
|
|
srcGeoIPASNumv6 = fetchDB
|
|
"asnum/GeoIPASNumv6.dat.gz" "GeoIPASNumv6.dat.gz"
|
|
"0q0vgjgxixcq5qnl5d6hxg3bpsbylmmjkhdp308vbbd68q6fws22";
|
|
|
|
meta = with stdenv.lib; {
|
|
description = "GeoLite Legacy IP geolocation databases";
|
|
homepage = https://geolite.maxmind.com/download/geoip;
|
|
license = licenses.cc-by-sa-30;
|
|
platforms = platforms.all;
|
|
maintainers = with maintainers; [ nckx ];
|
|
};
|
|
|
|
builder = ./builder.sh;
|
|
}
|