about summary refs log tree commit diff
path: root/pkgs/development/tools/oras
diff options
context:
space:
mode:
author06kellyjac <dev@j-k.io>2022-03-23 17:24:09 +0000
committer06kellyjac <dev@j-k.io>2022-03-23 17:24:09 +0000
commitb483ed3eda41628d87e8c64a83f7c394b517452b (patch)
tree9b02a1a27edd3e862254466a2fcfe10b656f925c /pkgs/development/tools/oras
parentd5767724527e4ae969e29c35bc47d566470961ca (diff)
oras: init at 0.12.0
Diffstat (limited to 'pkgs/development/tools/oras')
-rw-r--r--pkgs/development/tools/oras/default.nix40
1 files changed, 40 insertions, 0 deletions
diff --git a/pkgs/development/tools/oras/default.nix b/pkgs/development/tools/oras/default.nix
new file mode 100644
index 0000000000000..94a81144ccc20
--- /dev/null
+++ b/pkgs/development/tools/oras/default.nix
@@ -0,0 +1,40 @@
+{ lib, stdenv, buildGoModule, fetchFromGitHub }:
+
+buildGoModule rec {
+  pname = "oras";
+  version = "0.12.0";
+
+  src = fetchFromGitHub {
+    owner = "oras-project";
+    repo = "oras";
+    rev = "v${version}";
+    sha256 = "sha256-6W7vmWFjULIJnOVtgSrCEKw/83W8jNSbM0AF4LZZR6U=";
+  };
+  vendorSha256 = "sha256-3UKsH4Jbq7G5PRwhn5lW0NR80jhmuzT9daa++v2sFWk=";
+
+  ldflags = [
+    "-s"
+    "-w"
+    "-X github.com/oras-project/oras/internal/version.Version=${version}"
+    "-X github.com/oras-project/oras/internal/version.BuildMetadata="
+    "-X github.com/oras-project/oras/internal/version.GitTreeState=clean"
+  ];
+
+  doInstallCheck = true;
+  installCheckPhase = ''
+    runHook preInstallCheck
+
+    $out/bin/oras --help
+    $out/bin/oras version | grep "${version}"
+
+    runHook postInstallCheck
+  '';
+
+  meta = with lib; {
+    homepage = "https://oras.land/";
+    changelog = "https://github.com/oras-project/oras/releases/tag/v${version}";
+    description = "The ORAS project provides a way to push and pull OCI Artifacts to and from OCI Registries";
+    license = licenses.asl20;
+    maintainers = with maintainers; [ jk ];
+  };
+}