trivy: modernize (#488450)

This commit is contained in:
Fabian Affolter
2026-02-09 00:11:47 +00:00
committed by GitHub
+9 -13
View File
@@ -5,17 +5,17 @@
buildGoModule,
fetchFromGitHub,
installShellFiles,
testers,
trivy,
versionCheckHook,
}:
buildGoModule rec {
buildGoModule (finalAttrs: {
pname = "trivy";
version = "0.69.0";
src = fetchFromGitHub {
owner = "aquasecurity";
repo = "trivy";
tag = "v${version}";
tag = "v${finalAttrs.version}";
hash = "sha256-auCbZmVr7LzYrw+IOpXBZPUs2YmcPAzr5fo12vSyHeM=";
};
@@ -29,13 +29,15 @@ buildGoModule rec {
ldflags = [
"-s"
"-w"
"-X=github.com/aquasecurity/trivy/pkg/version/app.ver=${version}"
"-X=github.com/aquasecurity/trivy/pkg/version/app.ver=${finalAttrs.version}"
];
env.GOEXPERIMENT = "jsonv2";
nativeBuildInputs = [ installShellFiles ];
nativeInstallCheckInputs = [ versionCheckHook ];
# Tests require network access
doCheck = false;
@@ -48,16 +50,10 @@ buildGoModule rec {
doInstallCheck = true;
passthru.tests.version = testers.testVersion {
package = trivy;
command = "trivy --version";
version = "Version: ${version}";
};
meta = {
description = "Simple and comprehensive vulnerability scanner for containers, suitable for CI";
homepage = "https://github.com/aquasecurity/trivy";
changelog = "https://github.com/aquasecurity/trivy/releases/tag/v${version}";
changelog = "https://github.com/aquasecurity/trivy/releases/tag/${finalAttrs.src.tag}";
longDescription = ''
Trivy is a simple and comprehensive vulnerability scanner for containers
and other artifacts. A software vulnerability is a glitch, flaw, or
@@ -72,4 +68,4 @@ buildGoModule rec {
jk
];
};
}
})