geolite-legacy: 2015-03-26 -> 2015-04-16

Clean up: use a helper function to fetch database files.
This commit is contained in:
Tobias Geerinckx-Rice 2015-04-16 04:42:31 +02:00
parent a3aa361e91
commit 13f6f9046d
1 changed files with 22 additions and 27 deletions

View File

@ -1,35 +1,30 @@
{ stdenv, fetchurl }: { stdenv, fetchurl }:
# Annoyingly, these files are updated without a change in URL. This means that let
# builds will start failing every month or so, until the hashes are updated. fetchDB = name: sha256: fetchurl {
let version = "2015-03-26"; in inherit sha256;
url = "https://geolite.maxmind.com/download/geoip/database/${name}.dat.gz";
};
# Annoyingly, these files are updated without a change in URL. This means that
# builds will start failing every month or so, until the hashes are updated.
version = "2015-04-16";
in
stdenv.mkDerivation { stdenv.mkDerivation {
name = "geolite-legacy-${version}"; name = "geolite-legacy-${version}";
srcGeoIP = fetchurl { srcGeoIP = fetchDB "GeoLiteCountry/GeoIP"
url = https://geolite.maxmind.com/download/geoip/database/GeoLiteCountry/GeoIP.dat.gz; "15c7j6yyjl0k42ij7smdz2j451y3hhfbmxwkx8kp5ja0afrlw41k";
sha256 = "01xw896n9wcm1pv7sixfbh4gv6isl6m1i6lwag1c2bbcx6ci1zvr"; srcGeoIPv6 = fetchDB "GeoIPv6"
}; "0kz6yjprzqr2pi4rczbmw7489gdjzf957azahdqjai8fx0s5w93i";
srcGeoIPv6 = fetchurl { srcGeoLiteCity = fetchDB "GeoLiteCity"
url = https://geolite.maxmind.com/download/geoip/database/GeoIPv6.dat.gz; "0lc696axcdgz7xrh9p6ac5aa7nlxfgngwyabjwqiwazz3wcmw05a";
sha256 = "07l10hd7fkgk1nbw5gx4hjp61kdqqgri97fidn78dlk837rb02d0"; srcGeoLiteCityv6 = fetchDB "GeoLiteCityv6-beta/GeoLiteCityv6"
}; "1k8sig8w43cdm19rpwndr1akj1d3mxl5sch60qbinjrb05l6xbgv";
srcGeoLiteCity = fetchurl { srcGeoIPASNum = fetchDB "asnum/GeoIPASNum"
url = https://geolite.maxmind.com/download/geoip/database/GeoLiteCity.dat.gz; "08idbady3s43hgqr2mlm8r1ca1dpiyxj3b28skpxdsc5zm947r0b";
sha256 = "1xqjyz9xnga3dvhj0f38hf78wv781jflvqkxm6qni3sj781nfr4a"; srcGeoIPASNumv6 = fetchDB "asnum/GeoIPASNumv6"
}; "1rdk1ni432hf32kxgrsw6iaid0snl43favbc4252nmi3jy4h65zj";
srcGeoLiteCityv6 = fetchurl {
url = https://geolite.maxmind.com/download/geoip/database/GeoLiteCityv6-beta/GeoLiteCityv6.dat.gz;
sha256 = "03s41ffc5a13qy5kgx8jqya97jkw2qlvdkak98hab7xs0i17z9pd";
};
srcGeoIPASNum = fetchurl {
url = https://geolite.maxmind.com/download/geoip/database/asnum/GeoIPASNum.dat.gz;
sha256 = "1h766l8dsfgzlrz0q76877xksaf5qf91nwnkqwb6zl1gkczbwy6p";
};
srcGeoIPASNumv6 = fetchurl {
url = https://download.maxmind.com/download/geoip/database/asnum/GeoIPASNumv6.dat.gz;
sha256 = "0dwi9b3amfpmpkknf9ipz2r8aq05gn1j2zlvanwwah3ib5cgva9d";
};
meta = with stdenv.lib; { meta = with stdenv.lib; {
description = "GeoLite Legacy IP geolocation databases"; description = "GeoLite Legacy IP geolocation databases";