From 8b00d7f098eac0e1bb5eb52dad65146c251cdb13 Mon Sep 17 00:00:00 2001 From: Nick Cao Date: Sat, 3 Jun 2023 22:36:35 +0800 Subject: [PATCH] dbip-country-lite: init at 2023-06 --- pkgs/data/misc/dbip-country-lite/default.nix | 36 ++++++++++++++++++++ pkgs/top-level/all-packages.nix | 2 ++ 2 files changed, 38 insertions(+) create mode 100644 pkgs/data/misc/dbip-country-lite/default.nix diff --git a/pkgs/data/misc/dbip-country-lite/default.nix b/pkgs/data/misc/dbip-country-lite/default.nix new file mode 100644 index 000000000000..ffa2ec24974b --- /dev/null +++ b/pkgs/data/misc/dbip-country-lite/default.nix @@ -0,0 +1,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; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 192662252060..3d50814d8eb3 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -519,6 +519,8 @@ with pkgs; databricks-sql-cli = python3Packages.callPackage ../applications/misc/databricks-sql-cli { }; + dbip-country-lite = callPackage ../data/misc/dbip-country-lite { }; + dhallDirectoryToNix = callPackage ../build-support/dhall/directory-to-nix.nix { }; dhallPackageToNix = callPackage ../build-support/dhall/package-to-nix.nix { };