depot/nix/pkgs/heptapod-runner.nix

25 lines
754 B
Nix

{ pkgs, ... }:
let
version = "hpd-0.2.0";
newSrc = pkgs.fetchhg {
url = "https://mirror.octobus.net/heptapod/heptapod-runner";
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 = oldAttrs.buildInputs ++ [ wrappedMercurial pkgs.makeWrapper ];
src = newSrc;
postInstall = ''
wrapProgram $bin/bin/gitlab-runner --prefix PATH : ${wrappedMercurial}
'';
})