From cdbe7c69c2ac408df85f8ded225305ef12c0276b Mon Sep 17 00:00:00 2001 From: zowoq <59103226+zowoq@users.noreply.github.com> Date: Thu, 26 Jan 2023 20:05:08 +1000 Subject: [PATCH] buildah: wrap netavark via CONTAINERS_HELPER_BINARY_DIR consistent with podman wrapper --- pkgs/development/tools/buildah/wrapper.nix | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/pkgs/development/tools/buildah/wrapper.nix b/pkgs/development/tools/buildah/wrapper.nix index aa14a01b8644..575ee45d7d81 100644 --- a/pkgs/development/tools/buildah/wrapper.nix +++ b/pkgs/development/tools/buildah/wrapper.nix @@ -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} ''