about summary refs log tree commit diff
path: root/pkgs
diff options
context:
space:
mode:
authorSandro <sandro.jaeckel@gmail.com>2021-03-27 23:23:37 +0100
committerGitHub <noreply@github.com>2021-03-27 23:23:37 +0100
commitd1940ceca006c2fc16956f079f248a937c067efa (patch)
treed9e24f156dd60d54e23292a20167e0bd68be09fa /pkgs
parent979f8c9bb55bbbe151580fc0a9636e1e565facd6 (diff)
parent588da550f76715a92e927a70fc193da55c5eb159 (diff)
Merge pull request #117790 from fabaff/set-grype
grype: set version
Diffstat (limited to 'pkgs')
-rw-r--r--pkgs/tools/security/grype/default.nix10
1 files changed, 7 insertions, 3 deletions
diff --git a/pkgs/tools/security/grype/default.nix b/pkgs/tools/security/grype/default.nix
index d10b10e1d29d8..13bbdbb99d471 100644
--- a/pkgs/tools/security/grype/default.nix
+++ b/pkgs/tools/security/grype/default.nix
@@ -1,7 +1,7 @@
-{ buildGoModule
+{ lib
+, buildGoModule
 , docker
 , fetchFromGitHub
-, lib
 }:
 
 buildGoModule rec {
@@ -19,7 +19,11 @@ buildGoModule rec {
 
   propagatedBuildInputs = [ docker ];
 
-  # tests require a running Docker instance
+  preBuild = ''
+    buildFlagsArray+=("-ldflags" "-s -w -X github.com/anchore/grype/internal/version.version=${version}")
+  '';
+
+  # Tests require a running Docker instance
   doCheck = false;
 
   meta = with lib; {