default.nix (2166B)
1 { lib 2 , stdenvNoCC 3 , fetchFromGitHub 4 , hereApiKey ? "" 5 , mapboxApiKey ? "" 6 , maptilerApiKey ? "" 7 , mmlApiKey ? "" 8 , openrouteserviceApiKey ? "" 9 , thunderforestApiKey ? "" 10 , mapsList ? [ 11 "World/Asia/nakarte-*.xml" 12 "World/Europe/FI/*.xml" 13 "World/Europe/RU/*.xml" 14 "World/CyclOSM.xml" 15 "World/Esri-OSM.xml" 16 "World/Inkatlas-Outdoor.xml" 17 "World/MapTiler.xml" 18 "World/Mapbox.xml" 19 "World/OPNVKarte.xml" 20 "World/OpenStreetMap.xml" 21 "World/heidelberg.xml" 22 "World/here-*.xml" 23 "World/marshruty.ru.xml" 24 ] 25 }: 26 27 stdenvNoCC.mkDerivation { 28 pname = "gpxsee-maps"; 29 version = "2022-06-08"; 30 31 src = fetchFromGitHub { 32 owner = "tumic0"; 33 repo = "GPXSee-maps"; 34 rev = "87ae3ae6e2ee74066cee7ba8f78968b77191fc51"; 35 hash = "sha256-JT9/sNFP8jGBBxRZZgjlJ4OFvP9HxjFp7ehj2HVVrGs="; 36 }; 37 38 postPatch = let 39 insertApiKey = map: key: '' 40 substitute ${map}.{tpl,xml} \ 41 --replace "insert-your-apikey-here" "${key}" 42 ''; 43 in 44 '' 45 ${insertApiKey "World/Europe/FI/Ilmakuva" mmlApiKey} 46 ${insertApiKey "World/Europe/FI/Maastokartta" mmlApiKey} 47 ${insertApiKey "World/Europe/FI/Selkokartta" mmlApiKey} 48 ${insertApiKey "World/Europe/FI/Taustakartta" mmlApiKey} 49 ${insertApiKey "World/here-base" hereApiKey} 50 ${insertApiKey "World/here-vector" hereApiKey} 51 ${insertApiKey "World/heidelberg" openrouteserviceApiKey} 52 ${insertApiKey "World/MapTiler" maptilerApiKey} 53 ${insertApiKey "World/Mapbox" mapboxApiKey} 54 ${insertApiKey "World/Thunderforest-Landscape" thunderforestApiKey} 55 ${insertApiKey "World/Thunderforest-Neighbourhood" thunderforestApiKey} 56 ${insertApiKey "World/Thunderforest-OpenCycleMap" thunderforestApiKey} 57 ${insertApiKey "World/Thunderforest-Outdoors" thunderforestApiKey} 58 ${insertApiKey "World/Thunderforest-Transport" thunderforestApiKey} 59 ''; 60 61 installPhase = '' 62 install -dm755 $out 63 cp -r ${toString mapsList} $out 64 ''; 65 66 meta = with lib; { 67 description = "GPXSee maps"; 68 homepage = "https://tumic0.github.io/GPXSee-maps/"; 69 license = licenses.unlicense; 70 maintainers = [ maintainers.sikmir ]; 71 platforms = platforms.all; 72 }; 73 }