nixpkgs/pkgs/by-name/ci/cilium-cli/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

58 lines
1.4 KiB
Nix

{
lib,
buildGoModule,
cilium-cli,
fetchFromGitHub,
installShellFiles,
testers,
}:
buildGoModule rec {
pname = "cilium-cli";
version = "0.16.19";
src = fetchFromGitHub {
owner = "cilium";
repo = "cilium-cli";
rev = "refs/tags/v${version}";
hash = "sha256-I5HC1H517oCizZf2mcHOKmgJqnvPjkNVfDy2/9Kkw44=";
};
nativeBuildInputs = [ installShellFiles ];
vendorHash = null;
subPackages = [ "cmd/cilium" ];
ldflags = [
"-s" "-w"
"-X=github.com/cilium/cilium-cli/defaults.CLIVersion=${version}"
];
# Required to workaround install check error:
# 2022/06/25 10:36:22 Unable to start gops: mkdir /homeless-shelter: permission denied
HOME = "$TMPDIR";
postInstall = ''
installShellCompletion --cmd cilium \
--bash <($out/bin/cilium completion bash) \
--fish <($out/bin/cilium completion fish) \
--zsh <($out/bin/cilium completion zsh)
'';
passthru.tests.version = testers.testVersion {
package = cilium-cli;
command = "cilium version --client";
version = "${version}";
};
meta = {
description = "CLI to install, manage & troubleshoot Kubernetes clusters running Cilium";
homepage = "https://www.cilium.io/";
changelog = "https://github.com/cilium/cilium-cli/releases/tag/v${version}";
license = lib.licenses.asl20;
maintainers = with lib.maintainers; [ bryanasdev000 humancalico qjoly ];
mainProgram = "cilium";
};
}