nixpkgs/pkgs/by-name/is/istioctl/package.nix
aleksana 571c71e6f7 treewide: migrate packages to pkgs/by-name, take 1
We are migrating packages that meet below requirements:

1. using `callPackage`
2. called path is a directory
3. overriding set is empty (`{ }`)
4. not containing path expressions other than relative path (to
makenixpkgs-vet happy)
5. not referenced by nix files outside of the directory, other
than`pkgs/top-level/all-packages.nix`
6. not referencing nix files outside of the directory
7. not referencing `default.nix` (since it's changed to `package.nix`)
8. `outPath` doesn't change after migration

The tool is here: https://github.com/Aleksanaa/by-name-migrate.
2024-11-09 20:04:51 +08:00

49 lines
1.4 KiB
Nix

{ lib, buildGoModule, fetchFromGitHub, installShellFiles }:
buildGoModule rec {
pname = "istioctl";
version = "1.23.2";
src = fetchFromGitHub {
owner = "istio";
repo = "istio";
rev = version;
hash = "sha256-Vyd32T19dw0j7PfuAcs6cuDlAhtMnRcUZXvYtEM7D4w=";
};
vendorHash = "sha256-Sh/SsVIque5xdyOGCNU188pi0JCDXv90LlV7NCmgpGQ=";
nativeBuildInputs = [ installShellFiles ];
# Bundle release metadata
ldflags = let
attrs = [
"istio.io/istio/pkg/version.buildVersion=${version}"
"istio.io/istio/pkg/version.buildStatus=Nix"
"istio.io/istio/pkg/version.buildTag=${version}"
"istio.io/istio/pkg/version.buildHub=docker.io/istio"
];
in ["-s" "-w" "${lib.concatMapStringsSep " " (attr: "-X ${attr}") attrs}"];
subPackages = [ "istioctl/cmd/istioctl" ];
doInstallCheck = true;
installCheckPhase = ''
$out/bin/istioctl version --remote=false | grep ${version} > /dev/null
'';
postInstall = ''
$out/bin/istioctl collateral --man --bash --zsh
installManPage *.1
installShellCompletion istioctl.bash
installShellCompletion --zsh _istioctl
'';
meta = with lib; {
description = "Istio configuration command line utility for service operators to debug and diagnose their Istio mesh";
mainProgram = "istioctl";
homepage = "https://istio.io/latest/docs/reference/commands/istioctl";
license = licenses.asl20;
maintainers = with maintainers; [ bryanasdev000 veehaitch ];
};
}