From 9aaeb818d3705450467d8286e78648cb596aa357 Mon Sep 17 00:00:00 2001 From: Bruno Bigras Date: Tue, 25 Feb 2025 00:59:42 -0500 Subject: [PATCH] kargo: init at 1.3.0 Co-authored-by: nayeko <196556004+nayeko@users.noreply.github.com> Co-authored-by: Arne Keller --- pkgs/by-name/ka/kargo/package.nix | 74 +++++++++++++++++++++++++++++++ pkgs/top-level/aliases.nix | 1 - 2 files changed, 74 insertions(+), 1 deletion(-) create mode 100644 pkgs/by-name/ka/kargo/package.nix diff --git a/pkgs/by-name/ka/kargo/package.nix b/pkgs/by-name/ka/kargo/package.nix new file mode 100644 index 000000000000..8fc175096212 --- /dev/null +++ b/pkgs/by-name/ka/kargo/package.nix @@ -0,0 +1,74 @@ +{ + lib, + buildGoModule, + fetchFromGitHub, + installShellFiles, + kargo, + stdenv, + testers, + writableTmpDirAsHomeHook, +}: + +buildGoModule rec { + pname = "kargo"; + version = "1.3.0"; + + src = fetchFromGitHub { + owner = "akuity"; + repo = "kargo"; + tag = "v${version}"; + hash = "sha256-GC3u4v8qrVi8+Ne08f074DvPh0RFmpmCOdJ5XD3kk+o="; + }; + + vendorHash = "sha256-Xb+9zu2uivOYETtz3ryMnBUJ3gJ/1ta1dLEpsD00jpU="; + + subPackages = [ "cmd/cli" ]; + + ldflags = + let + package_url = "github.com/akuity/kargo/internal/version"; + in + [ + "-s" + "-w" + "-X ${package_url}.version=${version}" + "-X ${package_url}.buildDate=1970-01-01T00:00:00Z" + "-X ${package_url}.gitCommit=${src.rev}" + "-X ${package_url}.gitTreeState=clean" + ]; + + nativeBuildInputs = [ + installShellFiles + writableTmpDirAsHomeHook + ]; + + installPhase = '' + runHook preInstall + mkdir -p $out/bin + install -Dm755 "$GOPATH/bin/cli" -T $out/bin/kargo + runHook postInstall + ''; + + passthru.tests.version = testers.testVersion { + package = kargo; + command = "HOME=$TMPDIR ${meta.mainProgram} version --client"; + }; + + postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) '' + installShellCompletion --cmd kargo \ + --bash <($out/bin/kargo completion bash) \ + --fish <($out/bin/kargo completion fish) \ + --zsh <($out/bin/kargo completion zsh) + ''; + + meta = { + description = "Application lifecycle orchestration"; + mainProgram = "kargo"; + downloadPage = "https://github.com/akuity/kargo"; + homepage = "https://kargo.akuity.io"; + license = lib.licenses.asl20; + maintainers = with lib.maintainers; [ + bbigras + ]; + }; +} diff --git a/pkgs/top-level/aliases.nix b/pkgs/top-level/aliases.nix index eb58e4fbd9d0..0933251b73fc 100644 --- a/pkgs/top-level/aliases.nix +++ b/pkgs/top-level/aliases.nix @@ -702,7 +702,6 @@ mapAliases { kube3d = k3d; # Added 2022-0705 kafkacat = throw "'kafkacat' has been renamed to/replaced by 'kcat'"; # Converted to throw 2024-10-17 kak-lsp = kakoune-lsp; # Added 2024-04-01 - kargo = throw "kargo was removed as it is deprecated upstream and depends on the removed boto package"; # Added 2024-09-22 kdbplus = throw "'kdbplus' has been removed from nixpkgs"; # Added 2024-05-06 kdeconnect = throw "'kdeconnect' has been renamed to/replaced by 'plasma5Packages.kdeconnect-kde'"; # Converted to throw 2024-10-17 keepkey_agent = keepkey-agent; # added 2024-01-06