nixpkgs/pkgs/by-name/db/dbip-city-lite/package.nix
2024-11-01 11:30:26 -04:00

36 lines
876 B
Nix

{
lib,
stdenvNoCC,
fetchurl,
}:
stdenvNoCC.mkDerivation (finalAttrs: {
pname = "dbip-city-lite";
version = "2024-11";
src = fetchurl {
url = "https://download.db-ip.com/free/dbip-city-lite-${finalAttrs.version}.mmdb.gz";
hash = "sha256-w/Dl89AdhIfsfNu4IvVMEVKqZtQcqg0UAjB7HJxq/OE=";
};
dontUnpack = true;
installPhase = ''
runHook preBuild
gzip -c -d "$src" > dbip-city-lite.mmdb
install -Dm444 dbip-city-lite.mmdb "$out/share/dbip/dbip-city-lite.mmdb"
runHook postBuild
'';
passthru.mmdb = "${finalAttrs.finalPackage}/share/dbip/dbip-city-lite.mmdb";
meta = {
description = "Free IP to City Lite database by DB-IP";
homepage = "https://db-ip.com/db/download/ip-to-city-lite";
license = lib.licenses.cc-by-40;
maintainers = with lib.maintainers; [ Guanran928 ];
platforms = lib.platforms.all;
};
})