commit 6ce839cca76a8969deae42375ce900a4a7cc64c0
parent d2e48a85687068ab9ea1319393d7a542c8a30e9b
Author: Nikolay Korotkiy <sikmir@disroot.org>
Date: Thu, 24 Oct 2024 00:16:29 +0400
Add wms-tiles-downloader
Diffstat:
2 files changed, 55 insertions(+), 0 deletions(-)
diff --git a/pkgs/default.nix b/pkgs/default.nix
@@ -253,6 +253,7 @@ lib.makeScope newScope (
vt2geojson = callPackage ./geospatial/vt2geojson { };
titiler = callPackage ./geospatial/titiler { };
tilecloud = callPackage ./geospatial/tilecloud { };
+ wms-tiles-downloader = callPackage ./geospatial/wms-tiles-downloader { };
### GNSS
diff --git a/pkgs/geospatial/wms-tiles-downloader/default.nix b/pkgs/geospatial/wms-tiles-downloader/default.nix
@@ -0,0 +1,54 @@
+{
+ lib,
+ stdenv,
+ buildGoModule,
+ fetchFromGitHub,
+ buildPackages,
+ installShellFiles,
+}:
+
+buildGoModule rec {
+ pname = "wms-tiles-downloader";
+ version = "0.3.2";
+
+ src = fetchFromGitHub {
+ owner = "lmikolajczak";
+ repo = "wms-tiles-downloader";
+ rev = "v${version}";
+ hash = "sha256-b1QaquI0s8D9MeXbUNVZpGy3u9eCjakP5BQsyoMne1A=";
+ };
+
+ vendorHash = "sha256-9ICZowuE2qBxH12bJ8nDxr/sTM0I0JSKe5YtHJsYgi0=";
+
+ ldflags = [
+ "-s"
+ "-w"
+ ];
+
+ nativeBuildInputs = [ installShellFiles ];
+
+ postInstall =
+ let
+ wms-tiles-downloader =
+ if stdenv.buildPlatform.canExecute stdenv.hostPlatform then
+ placeholder "out"
+ else
+ buildPackages.wms-tiles-downloader;
+ in
+ ''
+ installShellCompletion --cmd wms-tiles-downloader \
+ --bash <(${wms-tiles-downloader}/bin/wms-tiles-downloader completion bash) \
+ --fish <(${wms-tiles-downloader}/bin/wms-tiles-downloader completion fish) \
+ --zsh <(${wms-tiles-downloader}/bin/wms-tiles-downloader completion zsh)
+ '';
+
+ __darwinAllowLocalNetworking = true;
+
+ meta = {
+ description = "CLI for downloading map tiles from WMS server";
+ homepage = "https://github.com/lmikolajczak/wms-tiles-downloader";
+ license = lib.licenses.mit;
+ mainProgram = "wms-tiles-downloader";
+ maintainers = [ lib.maintainers.sikmir ];
+ };
+}