depot/pkgs/by-name/db/dbip-asn-lite/package.nix
Luke Granger-Brown 57725ef3ec Squashed 'third_party/nixpkgs/' content from commit 76612b17c0ce
git-subtree-dir: third_party/nixpkgs
git-subtree-split: 76612b17c0ce71689921ca12d9ffdc9c23ce40b2
2024-11-10 23:59:47 +00:00

35 lines
868 B
Nix

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