about summary refs log tree commit diff
path: root/pkgs/tools
diff options
context:
space:
mode:
authorFabian Affolter <mail@fabian-affolter.ch>2024-04-05 00:45:05 +0200
committerFabian Affolter <mail@fabian-affolter.ch>2024-04-05 00:45:05 +0200
commite2df5831f922a571fc0a38fbb03bb1cf8396577f (patch)
tree322ed3d464e6417b16a1092e30c6fc59b278f658 /pkgs/tools
parentdaa500499a1d2756351bc67599763dcdd4d9c768 (diff)
syft: refactor
Diffstat (limited to 'pkgs/tools')
-rw-r--r--pkgs/tools/admin/syft/default.nix19
1 files changed, 12 insertions, 7 deletions
diff --git a/pkgs/tools/admin/syft/default.nix b/pkgs/tools/admin/syft/default.nix
index 92ef2469237d3..e55954ef41917 100644
--- a/pkgs/tools/admin/syft/default.nix
+++ b/pkgs/tools/admin/syft/default.nix
@@ -1,4 +1,8 @@
-{ lib, buildGoModule, fetchFromGitHub, installShellFiles }:
+{ lib
+, buildGoModule
+, fetchFromGitHub
+, installShellFiles
+}:
 
 buildGoModule rec {
   pname = "syft";
@@ -6,8 +10,8 @@ buildGoModule rec {
 
   src = fetchFromGitHub {
     owner = "anchore";
-    repo = pname;
-    rev = "v${version}";
+    repo = "syft";
+    rev = "refs/tags/v${version}";
     hash = "sha256-75puiKfXp8vS9iiSk6R85RBn9xlQp9jk51ZNBeJXc/U=";
     # populate values that require us to use git. By doing this in postFetch we
     # can delete .git afterwards and maintain better reproducibility of the src.
@@ -22,6 +26,7 @@ buildGoModule rec {
   };
   # hash mismatch with darwin
   proxyVendor = true;
+
   vendorHash = "sha256-AHzKmitIUw0CqBU2Xinb6UVnlZB+2ED85uqGUFonkWM=";
 
   nativeBuildInputs = [ installShellFiles ];
@@ -31,9 +36,9 @@ buildGoModule rec {
   ldflags = [
     "-s"
     "-w"
-    "-X main.version=${version}"
-    "-X main.gitDescription=v${version}"
-    "-X main.gitTreeState=clean"
+    "-X=main.version=${version}"
+    "-X=main.gitDescription=v${version}"
+    "-X=main.gitTreeState=clean"
   ];
 
   preBuild = ''
@@ -66,9 +71,9 @@ buildGoModule rec {
   '';
 
   meta = with lib; {
+    description = "CLI tool and library for generating a Software Bill of Materials from container images and filesystems";
     homepage = "https://github.com/anchore/syft";
     changelog = "https://github.com/anchore/syft/releases/tag/v${version}";
-    description = "CLI tool and library for generating a Software Bill of Materials from container images and filesystems";
     longDescription = ''
       A CLI tool and Go library for generating a Software Bill of Materials
       (SBOM) from container images and filesystems. Exceptional for