2023-04-29 16:46:19 +00:00
|
|
|
{ lib, fetchFromGitHub, buildGoModule, installShellFiles }:
|
2021-12-06 16:07:01 +00:00
|
|
|
|
|
|
|
buildGoModule rec {
|
|
|
|
pname = "nali";
|
2024-01-02 11:29:13 +00:00
|
|
|
version = "0.8.1";
|
2021-12-06 16:07:01 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "zu1k";
|
|
|
|
repo = "nali";
|
|
|
|
rev = "v${version}";
|
2024-01-02 11:29:13 +00:00
|
|
|
hash = "sha256-5AI8TAKYFqjgLVKob9imrf7yVmXmAPq/zHh1bDfC5r0=";
|
2021-12-06 16:07:01 +00:00
|
|
|
};
|
|
|
|
|
2023-10-19 13:55:26 +00:00
|
|
|
vendorHash = "sha256-wIp/ShUddz+RIcsEuKWUfxsV/wNB2X1jZtIltBZ0ROM=";
|
2021-12-06 16:07:01 +00:00
|
|
|
subPackages = [ "." ];
|
|
|
|
|
2023-04-29 16:46:19 +00:00
|
|
|
nativeBuildInputs = [ installShellFiles ];
|
|
|
|
|
2023-10-19 13:55:26 +00:00
|
|
|
CGO_ENABLED = 0;
|
|
|
|
ldflags = [ "-s" "-w" "-X github.com/zu1k/nali/internal/constant.Version=${version}" ];
|
|
|
|
|
2023-04-29 16:46:19 +00:00
|
|
|
postInstall = ''
|
|
|
|
installShellCompletion --cmd nali \
|
|
|
|
--bash <($out/bin/nali completion bash) \
|
|
|
|
--fish <($out/bin/nali completion fish) \
|
|
|
|
--zsh <($out/bin/nali completion zsh)
|
|
|
|
'';
|
|
|
|
|
2021-12-06 16:07:01 +00:00
|
|
|
meta = with lib; {
|
|
|
|
description = "An offline tool for querying IP geographic information and CDN provider";
|
|
|
|
homepage = "https://github.com/zu1k/nali";
|
|
|
|
license = licenses.mit;
|
2022-06-26 10:26:21 +00:00
|
|
|
maintainers = with maintainers; [ diffumist xyenon ];
|
2024-01-02 11:29:13 +00:00
|
|
|
mainProgram = "nali";
|
2021-12-06 16:07:01 +00:00
|
|
|
};
|
|
|
|
}
|