From ed8c77a9c69ed3e774228e9c379948058ff2b1d1 Mon Sep 17 00:00:00 2001 From: Luke Granger-Brown Date: Sat, 9 May 2020 13:22:49 +0100 Subject: [PATCH] heptapod-runner: make sure our wrapped Mercurial is on the PATH --- nix/pkgs/heptapod-runner.nix | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/nix/pkgs/heptapod-runner.nix b/nix/pkgs/heptapod-runner.nix index f7740ad6f2..975a50f740 100644 --- a/nix/pkgs/heptapod-runner.nix +++ b/nix/pkgs/heptapod-runner.nix @@ -6,16 +6,20 @@ let rev = "b4fda456f403"; sha256 = "1ybkd2jnq2dvkj157w2nlf9rmrgbd8kas43kimi9aarajgi9sri1"; }; + wrappedMercurial = pkgs.symlinkJoin { + name = pkgs.mercurial.name; + paths = [ pkgs.mercurial ]; + postBuild = '' + mkdir -p "$out/etc/mercurial" + cp "${newSrc}/dockerfiles/build/runner.hgrc" "$out/etc/mercurial/hgrc" + ''; + }; in pkgs.gitlab-runner.overrideAttrs (oldAttrs: rec { inherit version; - buildInputs = [ - (pkgs.mercurial.overrideAttrs (hgOldAttrs: rec { - postInstall = '' - mkdir -p "$out/etc/mercurial" - cp "${newSrc}/dockerfiles/build/runner.hgrc" "$out/etc/mercurial/hgrc" - ''; - })) - ]; + buildInputs = oldAttrs.buildInputs ++ [ wrappedMercurial pkgs.makeWrapper ]; src = newSrc; + postInstall = '' + wrapProgram $bin/bin/gitlab-runner --prefix PATH : ${wrappedMercurial} + ''; })