nur-packages

My NUR packages
git clone git://git.sikmir.ru/nur-packages
Log | Files | Refs | README | LICENSE

default.nix (2217B)


      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 = "2023-07-20";
     30 
     31   src = fetchFromGitHub {
     32     owner = "tumic0";
     33     repo = "GPXSee-maps";
     34     rev = "1097cd829f8fdd1f17304c4342f2d1258d2ac9e3";
     35     hash = "sha256-kucb7FJkM45GIIfBmcEBoR2fT4GCx9Ht0urxZfjlGiw=";
     36   };
     37 
     38   postPatch =
     39     let
     40       insertApiKey = map: key: ''
     41         substitute ${map}.{tpl,xml} \
     42           --replace-fail "insert-your-apikey-here" "${key}"
     43       '';
     44     in
     45     ''
     46       ${insertApiKey "World/Europe/FI/Ilmakuva" mmlApiKey}
     47       ${insertApiKey "World/Europe/FI/Maastokartta" mmlApiKey}
     48       ${insertApiKey "World/Europe/FI/Selkokartta" mmlApiKey}
     49       ${insertApiKey "World/Europe/FI/Taustakartta" mmlApiKey}
     50       ${insertApiKey "World/here-base" hereApiKey}
     51       ${insertApiKey "World/here-vector" hereApiKey}
     52       ${insertApiKey "World/heidelberg" openrouteserviceApiKey}
     53       ${insertApiKey "World/MapTiler" maptilerApiKey}
     54       ${insertApiKey "World/Mapbox" mapboxApiKey}
     55       ${insertApiKey "World/Thunderforest-Landscape" thunderforestApiKey}
     56       ${insertApiKey "World/Thunderforest-Neighbourhood" thunderforestApiKey}
     57       ${insertApiKey "World/Thunderforest-OpenCycleMap" thunderforestApiKey}
     58       ${insertApiKey "World/Thunderforest-Outdoors" thunderforestApiKey}
     59       ${insertApiKey "World/Thunderforest-Transport" thunderforestApiKey}
     60     '';
     61 
     62   installPhase = ''
     63     install -dm755 $out
     64     cp -r ${toString mapsList} $out
     65   '';
     66 
     67   meta = with lib; {
     68     description = "GPXSee maps";
     69     homepage = "https://tumic0.github.io/GPXSee-maps/";
     70     license = licenses.unlicense;
     71     maintainers = [ maintainers.sikmir ];
     72     platforms = platforms.all;
     73   };
     74 }