2022-02-12 12:11:32 +00:00
|
|
|
{ lib, stdenv, fetchurl, zstd }:
|
2015-03-31 13:54:06 +00:00
|
|
|
|
2022-07-30 19:26:57 +00:00
|
|
|
stdenv.mkDerivation rec {
|
2019-08-15 12:41:18 +00:00
|
|
|
pname = "geolite-legacy";
|
2023-09-07 08:56:16 +00:00
|
|
|
version = "20230901";
|
2022-02-12 12:11:32 +00:00
|
|
|
|
|
|
|
# We use Arch Linux package as a snapshot, because upstream database is updated in-place.
|
|
|
|
geoip = fetchurl {
|
2022-07-30 19:26:57 +00:00
|
|
|
url = "https://archive.archlinux.org/packages/g/geoip-database/geoip-database-${version}-1-any.pkg.tar.zst";
|
2023-09-07 08:56:16 +00:00
|
|
|
sha256 = "sha256-H6tv0OEf04TvbhbWsm5vwq+lBj4GSyOezd258VOT8yQ=";
|
2022-02-12 12:11:32 +00:00
|
|
|
};
|
2015-03-31 13:54:06 +00:00
|
|
|
|
2022-02-12 12:11:32 +00:00
|
|
|
extra = fetchurl {
|
2022-07-30 19:26:57 +00:00
|
|
|
url = "https://archive.archlinux.org/packages/g/geoip-database-extra/geoip-database-extra-${version}-1-any.pkg.tar.zst";
|
2023-09-07 08:56:16 +00:00
|
|
|
sha256 = "sha256-Zb5m5TLJ1vcPKypZ3NliaL9oluz97ukTVGlOehuzyPU=";
|
2022-02-12 12:11:32 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
nativeBuildInputs = [ zstd ];
|
|
|
|
|
|
|
|
buildCommand = ''
|
2022-07-30 19:26:57 +00:00
|
|
|
tar -xaf ${geoip}
|
|
|
|
tar -xaf ${extra}
|
2022-02-12 12:11:32 +00:00
|
|
|
mkdir -p $out/share
|
|
|
|
mv usr/share/GeoIP $out/share
|
|
|
|
'';
|
2015-03-31 13:54:06 +00:00
|
|
|
|
2021-01-11 07:54:33 +00:00
|
|
|
meta = with lib; {
|
2015-03-31 13:54:06 +00:00
|
|
|
description = "GeoLite Legacy IP geolocation databases";
|
2022-02-12 12:11:32 +00:00
|
|
|
homepage = "https://mailfud.org/geoip-legacy/";
|
|
|
|
license = licenses.cc-by-sa-40;
|
2015-08-05 22:30:09 +00:00
|
|
|
platforms = platforms.all;
|
2018-01-16 21:59:13 +00:00
|
|
|
maintainers = with maintainers; [ fpletz ];
|
2015-03-31 13:54:06 +00:00
|
|
|
};
|
|
|
|
}
|