3
0
Fork 0
forked from mirrors/nixpkgs

buildah: add wrapper

This commit is contained in:
zowoq 2020-05-12 03:58:44 +10:00 committed by Profpatsch
parent 2689dfaa08
commit dd67a7eacb
2 changed files with 54 additions and 1 deletions

View file

@ -0,0 +1,52 @@
{ buildah-unwrapped
, runCommand
, makeWrapper
, lib
, extraPackages ? []
, buildah
, runc # Default container runtime
, crun # Container runtime (default with cgroups v2 for podman/buildah)
, conmon # Container runtime monitor
, slirp4netns # User-mode networking for unprivileged namespaces
, fuse-overlayfs # CoW for images, much faster than default vfs
, utillinux # nsenter
, cni-plugins # not added to path
, iptables
}:
let
buildah = buildah-unwrapped;
binPath = lib.makeBinPath ([
runc
crun
conmon
slirp4netns
fuse-overlayfs
utillinux
iptables
] ++ extraPackages);
in runCommand buildah.name {
name = "${buildah.pname}-wrapper-${buildah.version}";
inherit (buildah) pname version;
meta = builtins.removeAttrs buildah.meta [ "outputsToInstall" ];
outputs = [
"out"
"man"
];
nativeBuildInputs = [
makeWrapper
];
} ''
ln -s ${buildah.man} $man
mkdir -p $out/bin
ln -s ${buildah-unwrapped}/share $out/share
makeWrapper ${buildah-unwrapped}/bin/buildah $out/bin/buildah \
--prefix PATH : ${binPath}
''

View file

@ -1369,7 +1369,8 @@ in
btfs = callPackage ../os-specific/linux/btfs { };
buildah = callPackage ../development/tools/buildah { };
buildah = callPackage ../development/tools/buildah/wrapper.nix { };
buildah-unwrapped = callPackage ../development/tools/buildah { };
buildkit = callPackage ../development/tools/buildkit { };