nur-packages

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

commit d7e76abd84d90d7156b812be55ad64a3994f1483
parent 7623eac4d1c8d39bb69b1fb335ef594384250f18
Author: Nikolay Korotkiy <sikmir@gmail.com>
Date:   Thu, 23 Apr 2020 19:56:48 +0300

Add nakarte

Diffstat:
Mnix/sources.json | 13+++++++++++++
Mpkgs/default.nix | 1+
Apkgs/servers/nakarte/default.nix | 28++++++++++++++++++++++++++++
3 files changed, 42 insertions(+), 0 deletions(-)

diff --git a/nix/sources.json b/nix/sources.json @@ -395,6 +395,19 @@ "url_template": "https://kartat-dl.hylly.org/<version>/mtk_suomi.img", "version": "2020-04-18" }, + "nakarte": { + "branch": "master", + "builtin": false, + "description": "Source code of site http://nakarte.me", + "homepage": "https://nakarte.me", + "owner": "wladich", + "repo": "nakarte", + "rev": "89c3e0a94a848a72d5c2b199100d565a9af0dbab", + "sha256": "1izh4fc946ksk6lzrv06sz81sd827ybgrgdmh7x32ap9lv3rqi9l", + "type": "tarball", + "url": "https://github.com/wladich/nakarte/archive/89c3e0a94a848a72d5c2b199100d565a9af0dbab.tar.gz", + "url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz" + }, "openmtbmap_openvelomap_linux": { "branch": "master", "builtin": false, diff --git a/pkgs/default.nix b/pkgs/default.nix @@ -142,6 +142,7 @@ lib.makeScope newScope ( ### SERVERS mbtileserver = callPackage ./servers/mbtileserver {}; + nakarte = callPackage ./servers/nakarte {}; ### MISC diff --git a/pkgs/servers/nakarte/default.nix b/pkgs/servers/nakarte/default.nix @@ -0,0 +1,28 @@ +{ stdenv, mkYarnPackage, sources, secretsConfig ? null }: + +mkYarnPackage rec { + name = "nakarte-${stdenv.lib.substring 0 7 src.rev}"; + src = sources.nakarte; + + postPatch = + if (secretsConfig != null) then + "cp ${builtins.toFile "secrets.js" secretsConfig} src/secrets.js" + else + "cp src/secrets.js.template src/secrets.js"; + + buildPhase = "yarn build"; + + installPhase = '' + install -dm755 $out/share/nginx + mv deps/nakarte/build $out/share/nginx/html + ''; + + distPhase = "true"; + + meta = with stdenv.lib; { + inherit (src) description homepage; + license = licenses.mit; + maintainers = with maintainers; [ sikmir ]; + platforms = platforms.all; + }; +}