mirror of
https://github.com/CHN-beta/nixpkgs.git
synced 2026-01-12 02:40:31 +08:00
kor: use finalAttrs and versionCheckHook (#439831)
This commit is contained in:
@@ -2,37 +2,41 @@
|
||||
lib,
|
||||
buildGoModule,
|
||||
fetchFromGitHub,
|
||||
writableTmpDirAsHomeHook,
|
||||
versionCheckHook,
|
||||
}:
|
||||
|
||||
buildGoModule rec {
|
||||
buildGoModule (finalAttrs: {
|
||||
pname = "kor";
|
||||
version = "0.6.4";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "yonahd";
|
||||
repo = "kor";
|
||||
rev = "v${version}";
|
||||
tag = "v${finalAttrs.version}";
|
||||
hash = "sha256-hGiak28gwxwYOogYyZjTgQ+aGSumxzeZiQKlbVvvrIU=";
|
||||
};
|
||||
|
||||
vendorHash = "sha256-a7B0cJi71mqGDPbXaWYKZ2AeuuQyNDxwWNgahTN5AW8=";
|
||||
|
||||
preCheck = ''
|
||||
HOME=$(mktemp -d)
|
||||
export HOME
|
||||
'';
|
||||
nativeCheckInputs = [ writableTmpDirAsHomeHook ];
|
||||
|
||||
ldflags = [
|
||||
"-s"
|
||||
"-w"
|
||||
"-X github.com/yonahd/kor/pkg/utils.Version=${finalAttrs.version}"
|
||||
];
|
||||
|
||||
nativeInstallCheckInputs = [ versionCheckHook ];
|
||||
versionCheckProgramArg = "version";
|
||||
doInstallCheck = true;
|
||||
|
||||
meta = {
|
||||
description = "Golang Tool to discover unused Kubernetes Resources";
|
||||
homepage = "https://github.com/yonahd/kor";
|
||||
changelog = "https://github.com/yonahd/kor/releases/tag/v${version}";
|
||||
changelog = "https://github.com/yonahd/kor/releases/tag/v${finalAttrs.version}";
|
||||
license = lib.licenses.mit;
|
||||
maintainers = [ lib.maintainers.ivankovnatsky ];
|
||||
mainProgram = "kor";
|
||||
};
|
||||
}
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user