depot/third_party/nixpkgs/pkgs/by-name/my/myks/package.nix
Default email fa5436e0a7 Project import generated by Copybara.
GitOrigin-RevId: e8057b67ebf307f01bdcc8fba94d94f75039d1f6
2024-06-05 17:53:02 +02:00

55 lines
1.3 KiB
Nix

{ lib,
buildGoModule,
fetchFromGitHub,
testers,
installShellFiles,
myks,
stdenv,
}:
buildGoModule rec {
pname = "myks";
version = "4.1.2";
src = fetchFromGitHub {
owner = "mykso";
repo = "myks";
rev = "refs/tags/v${version}";
hash = "sha256-ZRbirNhTEGqr6OCE0K873NJ5vI2Phe5z9XJGZUALISo=";
};
vendorHash = "sha256-u9dNmgFMn6OMkKgTwNSqizUHJwvRk+S1xKZDozWjbps=";
subPackages = ".";
ldflags = [
"-s"
"-w"
"-X=main.version=${version}"
"-X=main.commit=nixpkg-${version}"
"-X=main.date=1970-01-01"
];
nativeBuildInputs = [ installShellFiles ];
CGO_ENABLED = 0;
passthru.tests.version = testers.testVersion { package = myks; };
postInstall =
lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
installShellCompletion --cmd myks \
--bash <($out/bin/myks completion bash) \
--zsh <($out/bin/myks completion zsh) \
--fish <($out/bin/myks completion fish)
'';
meta = with lib; {
changelog = "https://github.com/mykso/myks/blob/v${version}/CHANGELOG.md";
description = "A configuration framework for Kubernetes applications";
license = licenses.mit;
homepage = "https://github.com/mykso/myks";
maintainers = [ maintainers.kbudde ];
mainProgram = "myks";
};
}