default.nix (899B)
1 { lib, fetchurl, unzip, country ? "RUS" }: 2 let 3 pname = "gadm-" + country; 4 version = "3.6"; 5 in 6 fetchurl { 7 name = "${pname}-${version}"; 8 url = "https://biogeo.ucdavis.edu/data/gadm${version}/gpkg/gadm${lib.replaceStrings [ "." ] [ "" ] version}_${country}_gpkg.zip"; 9 hash = { 10 RUS = "sha256-buGdrpsbgcYlaJSxOOeHLXQLEmAHMfy7/eDf4ZpXs/4="; 11 FIN = "sha256-avDQrL5OWix/13MbfQdoUd/dmRPmcCnMt0ohmUqlkGQ="; 12 EST = "sha256-+9vErTSvu52eG03ohnRcC9hk9d10Unpyji8WVbfuaq4="; 13 }.${country}; 14 downloadToTemp = true; 15 recursiveHash = true; 16 preferLocalBuild = true; 17 postFetch = "${unzip}/bin/unzip $downloadedFile -d $out"; 18 19 meta = with lib; { 20 description = "GADM data"; 21 homepage = "https://gadm.org"; 22 changelog = "https://gadm.org/changelog.html"; 23 license = licenses.free; 24 maintainers = [ maintainers.sikmir ]; 25 platforms = platforms.all; 26 skip.ci = true; 27 }; 28 }