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