biome: 1.9.2 -> 1.9.3
[NixPkgs.git] / pkgs / applications / networking / nali / default.nix
blob55c23d865a4501906b8d74847f0d983058fa6c94
1 { lib, stdenv, fetchFromGitHub, buildGoModule, installShellFiles }:
3 buildGoModule rec {
4   pname = "nali";
5   version = "0.8.1";
7   src = fetchFromGitHub {
8     owner = "zu1k";
9     repo = "nali";
10     rev = "v${version}";
11     hash = "sha256-5AI8TAKYFqjgLVKob9imrf7yVmXmAPq/zHh1bDfC5r0=";
12   };
14   vendorHash = "sha256-wIp/ShUddz+RIcsEuKWUfxsV/wNB2X1jZtIltBZ0ROM=";
15   subPackages = [ "." ];
17   nativeBuildInputs = [ installShellFiles ];
19   CGO_ENABLED = 0;
20   ldflags = [ "-s" "-w" "-X github.com/zu1k/nali/internal/constant.Version=${version}" ];
22   postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
23       export HOME="$TMPDIR"
24       # write to temp files to avoid race condition in config loading
25       $out/bin/nali completion bash > nali.bash
26       $out/bin/nali completion fish > nali.fish
27       $out/bin/nali completion zsh  > nali.zsh
28       installShellCompletion --cmd nali nali.{bash,fish,zsh}
29   '';
31   meta = with lib; {
32     description = "Offline tool for querying IP geographic information and CDN provider";
33     homepage = "https://github.com/zu1k/nali";
34     license = licenses.mit;
35     maintainers = with maintainers; [ diffumist xyenon ];
36     mainProgram = "nali";
37   };