@@ -1,11 +1,11 @@
1−{ lib, buildGoModule, buildGoPackage, fetchFromGitHub, installShellFiles }:
1+{ lib, buildGoModule, buildGoPackage, fetchFromGitHub, installShellFiles, pkgsBuildBuild, stdenv }:
22
33let
44 # Argo can package a static server in the CLI using the `staticfiles` go module.
55 # We build the CLI without the static server for simplicity, but the tool is still required for
66 # compilation to succeed.
77 # See: https://github.com/argoproj/argo/blob/d7690e32faf2ac5842468831daf1443283703c25/Makefile#L117
8− staticfiles = buildGoPackage rec {
8+ staticfiles = pkgsBuildBuild.buildGoPackage rec {
99 name = "staticfiles";
1010 src = fetchFromGitHub {
1111 owner = "bouk";
@@ -54,7 +54,10 @@ buildGoModule rec {
5454
5555 postInstall = ''
5656 for shell in bash zsh; do
57− $out/bin/argo completion $shell > argo.$shell
57+ ${if (stdenv.buildPlatform == stdenv.hostPlatform)
58+ then "$out/bin/argo"
59+ else "${pkgsBuildBuild.argo}/bin/argo"
60+ } completion $shell > argo.$shell
5861 installShellCompletion argo.$shell
5962 done
6063 '';