nur-packages

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

default.nix (2231B)


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