1{
2 lib,
3 stdenv,
4 buildGoModule,
5 fetchFromGitHub,
6 installShellFiles,
7 pkgsBuildBuild,
8}:
9
10buildGoModule rec {
11 pname = "argo-workflows";
12 version = "3.6.10";
13
14 src = fetchFromGitHub {
15 owner = "argoproj";
16 repo = "argo";
17 tag = "v${version}";
18 hash = "sha256-TM/eK8biMxKV4SFJ1Lys+NPPeaHVjbBo83k2RH1Xi40=";
19 };
20
21 vendorHash = "sha256-Y/2+ykzcJdA5uwP1v9Z1wZtF3hBV2x7XZc7+FhPJP64=";
22
23 doCheck = false;
24
25 subPackages = [
26 "cmd/argo"
27 ];
28
29 nativeBuildInputs = [
30 installShellFiles
31 ];
32
33 ldflags = [
34 "-s"
35 "-w"
36 "-X github.com/argoproj/argo-workflows/v3.buildDate=unknown"
37 "-X github.com/argoproj/argo-workflows/v3.gitCommit=${src.rev}"
38 "-X github.com/argoproj/argo-workflows/v3.gitTag=${src.rev}"
39 "-X github.com/argoproj/argo-workflows/v3.gitTreeState=clean"
40 "-X github.com/argoproj/argo-workflows/v3.version=${version}"
41 ];
42
43 postInstall = ''
44 for shell in bash zsh; do
45 ${
46 if (stdenv.buildPlatform == stdenv.hostPlatform) then
47 "$out/bin/argo"
48 else
49 "${pkgsBuildBuild.argo}/bin/argo"
50 } completion $shell > argo.$shell
51 installShellCompletion argo.$shell
52 done
53 '';
54
55 meta = {
56 description = "Container native workflow engine for Kubernetes";
57 mainProgram = "argo";
58 homepage = "https://github.com/argoproj/argo";
59 changelog = "https://github.com/argoproj/argo-workflows/blob/v${version}/CHANGELOG.md";
60 license = lib.licenses.asl20;
61 maintainers = with lib.maintainers; [ groodt ];
62 platforms = lib.platforms.unix;
63 };
64}