@@ -1,19 +1,13 @@
1−{ stdenv, buildGoPackage, fetchFromGitHub, makeWrapper, coreutils, git, openssh, bash, gnused, gnugrep }:
1+{ stdenv, buildGoPackage, makeWrapper, coreutils, git, openssh, bash, gnused, gnugrep
2+, src, version, hasBootstrapScript
3+, ... }:
24let
3− version = "2.6.10";
45 goPackagePath = "github.com/buildkite/agent";
56in
67buildGoPackage {
78 name = "buildkite-agent-${version}";
89
9− inherit goPackagePath;
10−
11− src = fetchFromGitHub {
12− owner = "buildkite";
13− repo = "agent";
14− rev = "v${version}";
15− sha256 = "07065hhhb418w5qlqnyiap45r59paysysbwz1l7dmaw3j4q8m8rg";
16− };
10+ inherit goPackagePath src;
1711
1812 nativeBuildInputs = [ makeWrapper ];
1913
@@ -22,18 +16,20 @@ buildGoPackage {
2216 noAuditTmpdir = stdenv.isLinux;
2317
2418 postInstall = ''
19+ ${stdenv.lib.optionalString hasBootstrapScript ''
2520 # Install bootstrap.sh
2621 mkdir -p $bin/libexec/buildkite-agent
2722 cp $NIX_BUILD_TOP/go/src/${goPackagePath}/templates/bootstrap.sh $bin/libexec/buildkite-agent
2823 sed -e "s|#!/bin/bash|#!${bash}/bin/bash|g" -i $bin/libexec/buildkite-agent/bootstrap.sh
24+ ''}
2925
3026 # Fix binary name
3127 mv $bin/bin/{agent,buildkite-agent}
3228
3329 # These are runtime dependencies
3430 wrapProgram $bin/bin/buildkite-agent \
35− --prefix PATH : '${stdenv.lib.makeBinPath [ openssh git coreutils gnused gnugrep ]}' \
36− --set BUILDKITE_BOOTSTRAP_SCRIPT_PATH $bin/libexec/buildkite-agent/bootstrap.sh
31+ ${stdenv.lib.optionalString hasBootstrapScript "--set BUILDKITE_BOOTSTRAP_SCRIPT_PATH $bin/libexec/buildkite-agent/bootstrap.sh"} \
32+ --prefix PATH : '${stdenv.lib.makeBinPath [ openssh git coreutils gnused gnugrep ]}'
3733 '';
3834
3935 meta = with stdenv.lib; {
@@ -47,7 +43,7 @@ buildGoPackage {
4743 '';
4844 homepage = https://buildkite.com/docs/agent;
4945 license = licenses.mit;
50− maintainers = with maintainers; [ pawelpacana zimbatm ];
46+ maintainers = with maintainers; [ pawelpacana zimbatm rvl ];
5147 platforms = platforms.unix;
5248 };
5349}