nixpkgs/pkgs/data/misc/geolite-legacy/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

35 lines
1.0 KiB
Nix
Raw Normal View History

{ lib, stdenv, fetchurl, zstd }:
2022-07-30 19:26:57 +00:00
stdenv.mkDerivation rec {
pname = "geolite-legacy";
2023-09-07 08:56:16 +00:00
version = "20230901";
# 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=";
};
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=";
};
nativeBuildInputs = [ zstd ];
buildCommand = ''
2022-07-30 19:26:57 +00:00
tar -xaf ${geoip}
tar -xaf ${extra}
mkdir -p $out/share
mv usr/share/GeoIP $out/share
'';
meta = with lib; {
description = "GeoLite Legacy IP geolocation databases";
homepage = "https://mailfud.org/geoip-legacy/";
license = licenses.cc-by-sa-40;
platforms = platforms.all;
maintainers = with maintainers; [ fpletz ];
};
}