buildah: wrap netavark via CONTAINERS_HELPER_BINARY_DIR

consistent with podman wrapper
This commit is contained in:
zowoq 2023-01-26 20:05:08 +10:00
parent ec58d4089e
commit cdbe7c69c2

View File

@ -1,6 +1,7 @@
{ buildah-unwrapped
, runCommand
, makeWrapper
, symlinkJoin
, lib
, stdenv
, extraPackages ? []
@ -11,6 +12,8 @@
, fuse-overlayfs # CoW for images, much faster than default vfs
, util-linux # nsenter
, iptables
, aardvark-dns
, netavark
}:
let
@ -25,6 +28,17 @@ let
iptables
] ++ extraPackages);
helpersBin = symlinkJoin {
name = "${buildah-unwrapped.pname}-helper-binary-wrapper-${buildah-unwrapped.version}";
# this only works for some binaries, others may need to be be added to `binPath` or in the modules
paths = [
] ++ lib.optionals stdenv.isLinux [
aardvark-dns
netavark
];
};
in runCommand buildah-unwrapped.name {
name = "${buildah-unwrapped.pname}-wrapper-${buildah-unwrapped.version}";
inherit (buildah-unwrapped) pname version;
@ -48,5 +62,6 @@ in runCommand buildah-unwrapped.name {
mkdir -p $out/bin
ln -s ${buildah-unwrapped}/share $out/share
makeWrapper ${buildah-unwrapped}/bin/buildah $out/bin/buildah \
--set CONTAINERS_HELPER_BINARY_DIR ${helpersBin}/bin \
--prefix PATH : ${binPath}
''