nixpkgs/pkgs/by-name/ge/geolite-legacy/package.nix
aleksana 571c71e6f7 treewide: migrate packages to pkgs/by-name, take 1
We are migrating packages that meet below requirements:

1. using `callPackage`
2. called path is a directory
3. overriding set is empty (`{ }`)
4. not containing path expressions other than relative path (to
makenixpkgs-vet happy)
5. not referenced by nix files outside of the directory, other
than`pkgs/top-level/all-packages.nix`
6. not referencing nix files outside of the directory
7. not referencing `default.nix` (since it's changed to `package.nix`)
8. `outPath` doesn't change after migration

The tool is here: https://github.com/Aleksanaa/by-name-migrate.
2024-11-09 20:04:51 +08:00

41 lines
1.1 KiB
Nix

{
lib,
stdenv,
fetchzip,
zstd,
}:
stdenv.mkDerivation rec {
pname = "geolite-legacy";
version = "20240720";
# We use Arch Linux package as a snapshot, because upstream database is updated in-place.
geoip = fetchzip {
url = "https://archive.archlinux.org/packages/g/geoip-database/geoip-database-${version}-1-any.pkg.tar.zst";
hash = "sha256-9rPp1Lu6Q4+Cb4N4e/ezHacpLuUwbGQefEPuSrH8O6o=";
nativeBuildInputs = [ zstd ];
stripRoot = false;
};
extra = fetchzip {
url = "https://archive.archlinux.org/packages/g/geoip-database-extra/geoip-database-extra-${version}-1-any.pkg.tar.zst";
hash = "sha256-sb06yszstKalc+b9rSuStRuY3YRebAL1Q4jEJkbGiMI=";
nativeBuildInputs = [ zstd ];
stripRoot = false;
};
buildCommand = ''
mkdir -p $out/share/GeoIP
cp ${geoip}/usr/share/GeoIP/*.dat $out/share/GeoIP
cp ${extra}/usr/share/GeoIP/*.dat $out/share/GeoIP
'';
meta = {
description = "GeoLite Legacy IP geolocation databases";
homepage = "https://mailfud.org/geoip-legacy/";
license = lib.licenses.cc-by-sa-40;
platforms = lib.platforms.all;
maintainers = with lib.maintainers; [ fpletz ];
};
}