2021-03-15 08:37:03 +00:00
|
|
|
{ haskell, haskellPackages, lib, makeWrapper, runc, stdenv }:
|
|
|
|
let
|
2021-12-06 16:07:01 +00:00
|
|
|
inherit (haskell.lib.compose) overrideCabal addBuildDepends justStaticExecutables;
|
2021-03-15 08:37:03 +00:00
|
|
|
inherit (lib) makeBinPath;
|
|
|
|
bundledBins = lib.optional stdenv.isLinux runc;
|
|
|
|
|
|
|
|
pkg =
|
|
|
|
# justStaticExecutables is needed due to https://github.com/NixOS/nix/issues/2990
|
|
|
|
overrideCabal
|
|
|
|
(o: {
|
|
|
|
postInstall = ''
|
|
|
|
${o.postInstall or ""}
|
|
|
|
mkdir -p $out/libexec
|
|
|
|
mv $out/bin/hci $out/libexec
|
2022-05-18 14:49:53 +00:00
|
|
|
makeWrapper $out/libexec/hci $out/bin/hci --prefix PATH : ${lib.escapeShellArg (makeBinPath bundledBins)}
|
2021-03-15 08:37:03 +00:00
|
|
|
'';
|
2021-12-06 16:07:01 +00:00
|
|
|
})
|
|
|
|
(addBuildDepends [ makeWrapper ] (justStaticExecutables haskellPackages.hercules-ci-cli));
|
2021-03-15 08:37:03 +00:00
|
|
|
in pkg // {
|
|
|
|
meta = pkg.meta // {
|
|
|
|
position = toString ./default.nix + ":1";
|
|
|
|
};
|
|
|
|
}
|