package.nix (1420B)
1 { 2 lib, 3 stdenv, 4 buildGoModule, 5 fetchFromGitHub, 6 buildPackages, 7 installShellFiles, 8 }: 9 10 buildGoModule (finalAttrs: { 11 pname = "wms-tiles-downloader"; 12 version = "0.3.2"; 13 14 __structuredAttrs = true; 15 16 src = fetchFromGitHub { 17 owner = "lmikolajczak"; 18 repo = "wms-tiles-downloader"; 19 tag = "v${finalAttrs.version}"; 20 hash = "sha256-b1QaquI0s8D9MeXbUNVZpGy3u9eCjakP5BQsyoMne1A="; 21 }; 22 23 vendorHash = "sha256-9ICZowuE2qBxH12bJ8nDxr/sTM0I0JSKe5YtHJsYgi0="; 24 25 ldflags = [ 26 "-s" 27 "-w" 28 ]; 29 30 nativeBuildInputs = [ installShellFiles ]; 31 32 postInstall = 33 let 34 wms-tiles-downloader = 35 if stdenv.buildPlatform.canExecute stdenv.hostPlatform then 36 placeholder "out" 37 else 38 buildPackages.wms-tiles-downloader; 39 in 40 '' 41 installShellCompletion --cmd wms-tiles-downloader \ 42 --bash <(${wms-tiles-downloader}/bin/wms-tiles-downloader completion bash) \ 43 --fish <(${wms-tiles-downloader}/bin/wms-tiles-downloader completion fish) \ 44 --zsh <(${wms-tiles-downloader}/bin/wms-tiles-downloader completion zsh) 45 ''; 46 47 __darwinAllowLocalNetworking = true; 48 49 meta = { 50 description = "CLI for downloading map tiles from WMS server"; 51 homepage = "https://github.com/lmikolajczak/wms-tiles-downloader"; 52 license = lib.licenses.mit; 53 mainProgram = "wms-tiles-downloader"; 54 maintainers = [ lib.maintainers.sikmir ]; 55 }; 56 })
