mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-15 14:26:33 +01:00
35 lines
891 B
Nix
35 lines
891 B
Nix
{ lib
|
|
, stdenvNoCC
|
|
, fetchurl
|
|
}:
|
|
|
|
stdenvNoCC.mkDerivation (finalAttrs: {
|
|
pname = "dbip-country-lite";
|
|
version = "2024-09";
|
|
|
|
src = fetchurl {
|
|
url = "https://download.db-ip.com/free/dbip-country-lite-${finalAttrs.version}.mmdb.gz";
|
|
hash = "sha256-Y3uLIETUMfR/IEXfhqz3srAJxe8yM7oRi+DrA2tL15Y=";
|
|
};
|
|
|
|
dontUnpack = true;
|
|
|
|
installPhase = ''
|
|
runHook preBuild
|
|
|
|
gzip -c -d "$src" > dbip-country-lite.mmdb
|
|
install -Dm444 dbip-country-lite.mmdb "$out/share/dbip/dbip-country-lite.mmdb"
|
|
|
|
runHook postBuild
|
|
'';
|
|
|
|
passthru.mmdb = "${finalAttrs.finalPackage}/share/dbip/dbip-country-lite.mmdb";
|
|
|
|
meta = with lib; {
|
|
description = "Free IP to Country Lite database by DB-IP";
|
|
homepage = "https://db-ip.com/db/download/ip-to-country-lite";
|
|
license = licenses.cc-by-40;
|
|
maintainers = with maintainers; [ nickcao ];
|
|
platforms = platforms.all;
|
|
};
|
|
})
|