blob: ffa2ec24974b7c778d790470704385763cbc7fed (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
|
{ lib
, stdenvNoCC
, fetchurl
, dbip-country-lite
}:
stdenvNoCC.mkDerivation rec {
pname = "dbip-country-lite";
version = "2023-06";
src = fetchurl {
url = "https://download.db-ip.com/free/dbip-country-lite-${version}.mmdb.gz";
hash = "sha256-H+f7OhI03qhgpldF05Nc5ohPIPNhyVRCwiVqeWkvIbc=";
};
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 = "${dbip-country-lite}/share/dbip/dbip-country-lite.mmdb";
meta = with lib; {
description = "The 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;
};
}
|