nur-packages

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

package.nix (2260B)


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