41 lines
1.3 KiB
Nix
41 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-06-13";
|
|
|
|
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"
|
|
"156mkrizbnjs90lg2gqdlx1zzvpn81c83jiyprv12638zfgvqc7z";
|
|
srcGeoIPASNumv6 = fetchDB
|
|
"asnum/GeoIPASNumv6.dat.gz" "GeoIPASNumv6.dat.gz"
|
|
"1wd838achh7wayl6bxmj0yywp5m2zbqk4xghng4mwmmnda6pa0f5";
|
|
|
|
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;
|
|
}
|