mirror of
https://github.com/NixOS/nixpkgs.git
synced 2026-08-26 02:05:02 +00:00
cnspec: add versionCheckHook (#552627)
This commit is contained in:
@@ -2,6 +2,9 @@
|
||||
lib,
|
||||
buildGoModule,
|
||||
fetchFromGitHub,
|
||||
getent,
|
||||
versionCheckHook,
|
||||
writableTmpDirAsHomeHook,
|
||||
}:
|
||||
|
||||
buildGoModule (finalAttrs: {
|
||||
@@ -21,12 +24,23 @@ buildGoModule (finalAttrs: {
|
||||
|
||||
subPackages = [ "apps/cnspec" ];
|
||||
|
||||
nativeInstallCheckInputs = [
|
||||
getent
|
||||
writableTmpDirAsHomeHook
|
||||
versionCheckHook
|
||||
];
|
||||
|
||||
ldflags = [
|
||||
"-s"
|
||||
"-w"
|
||||
"-X=go.mondoo.com/cnspec.Version=${finalAttrs.version}"
|
||||
"-X=go.mondoo.com/cnspec/v${(lib.versions.major finalAttrs.version)}.Version=${finalAttrs.version}"
|
||||
];
|
||||
|
||||
doInstallCheck = true;
|
||||
|
||||
versionCheckKeepEnvironment = "HOME PATH";
|
||||
|
||||
versionCheckProgramArg = [ "version" ];
|
||||
|
||||
meta = {
|
||||
description = "Open source, cloud-native security and policy project";
|
||||
homepage = "https://github.com/mondoohq/cnspec";
|
||||
@@ -36,5 +50,6 @@ buildGoModule (finalAttrs: {
|
||||
fab
|
||||
mariuskimmina
|
||||
];
|
||||
mainProgram = "cnspec";
|
||||
};
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user