2020-05-29 06:06:01 +00:00
|
|
|
{ buildah-unwrapped
|
|
|
|
, runCommand
|
|
|
|
, makeWrapper
|
2023-02-02 18:25:31 +00:00
|
|
|
, symlinkJoin
|
2020-05-29 06:06:01 +00:00
|
|
|
, lib
|
2022-08-21 13:32:41 +00:00
|
|
|
, stdenv
|
2020-05-29 06:06:01 +00:00
|
|
|
, extraPackages ? []
|
|
|
|
, 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
|
2020-11-24 20:58:05 +00:00
|
|
|
, util-linux # nsenter
|
2020-05-29 06:06:01 +00:00
|
|
|
, iptables
|
2023-02-02 18:25:31 +00:00
|
|
|
, aardvark-dns
|
|
|
|
, netavark
|
2020-05-29 06:06:01 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
let
|
|
|
|
binPath = lib.makeBinPath ([
|
2022-08-21 13:32:41 +00:00
|
|
|
] ++ lib.optionals stdenv.isLinux [
|
2020-05-29 06:06:01 +00:00
|
|
|
runc
|
|
|
|
crun
|
|
|
|
conmon
|
|
|
|
slirp4netns
|
|
|
|
fuse-overlayfs
|
2020-11-24 20:58:05 +00:00
|
|
|
util-linux
|
2020-05-29 06:06:01 +00:00
|
|
|
iptables
|
|
|
|
] ++ extraPackages);
|
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
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
|
|
|
|
];
|
|
|
|
};
|
|
|
|
|
2022-11-21 17:40:18 +00:00
|
|
|
in runCommand buildah-unwrapped.name {
|
|
|
|
name = "${buildah-unwrapped.pname}-wrapper-${buildah-unwrapped.version}";
|
|
|
|
inherit (buildah-unwrapped) pname version;
|
|
|
|
|
|
|
|
preferLocalBuild = true;
|
2020-05-29 06:06:01 +00:00
|
|
|
|
2022-11-21 17:40:18 +00:00
|
|
|
meta = builtins.removeAttrs buildah-unwrapped.meta [ "outputsToInstall" ];
|
2020-05-29 06:06:01 +00:00
|
|
|
|
|
|
|
outputs = [
|
|
|
|
"out"
|
|
|
|
"man"
|
|
|
|
];
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
makeWrapper
|
|
|
|
];
|
|
|
|
|
|
|
|
} ''
|
2022-11-21 17:40:18 +00:00
|
|
|
ln -s ${buildah-unwrapped.man} $man
|
2020-05-29 06:06:01 +00:00
|
|
|
|
|
|
|
mkdir -p $out/bin
|
|
|
|
ln -s ${buildah-unwrapped}/share $out/share
|
|
|
|
makeWrapper ${buildah-unwrapped}/bin/buildah $out/bin/buildah \
|
2023-02-02 18:25:31 +00:00
|
|
|
--set CONTAINERS_HELPER_BINARY_DIR ${helpersBin}/bin \
|
2020-05-29 06:06:01 +00:00
|
|
|
--prefix PATH : ${binPath}
|
|
|
|
''
|