2020-04-28 20:23:03 +00:00
|
|
|
{ podman-unwrapped
|
|
|
|
, runCommand
|
|
|
|
, makeWrapper
|
2022-02-17 00:56:18 +00:00
|
|
|
, symlinkJoin
|
2020-04-28 20:23:03 +00:00
|
|
|
, lib
|
|
|
|
, extraPackages ? []
|
|
|
|
, podman # Docker compat
|
|
|
|
, runc # Default container runtime
|
2020-05-11 17:58:45 +00:00
|
|
|
, crun # Container runtime (default with cgroups v2 for podman/buildah)
|
2020-04-28 20:23:03 +00:00
|
|
|
, conmon # Container runtime monitor
|
|
|
|
, slirp4netns # User-mode networking for unprivileged namespaces
|
|
|
|
, fuse-overlayfs # CoW for images, much faster than default vfs
|
2020-11-24 15:29:28 +00:00
|
|
|
, util-linux # nsenter
|
2020-05-11 17:58:45 +00:00
|
|
|
, cni-plugins # not added to path
|
2020-04-28 20:23:03 +00:00
|
|
|
, iptables
|
2021-05-25 15:39:23 +00:00
|
|
|
, iproute2
|
2022-02-17 00:56:18 +00:00
|
|
|
, catatonit
|
2020-04-28 20:23:03 +00:00
|
|
|
}:
|
|
|
|
|
2022-02-17 00:56:18 +00:00
|
|
|
# do not add qemu to this wrapper, store paths get written to the podman vm config and break when GCed
|
|
|
|
|
|
|
|
# adding aardvark-dns/netavark to `helpersBin` requires changes to the modules and tests
|
|
|
|
|
2020-04-28 20:23:03 +00:00
|
|
|
let
|
|
|
|
podman = podman-unwrapped;
|
|
|
|
|
2021-10-08 23:48:28 +00:00
|
|
|
binPath = lib.makeBinPath ([
|
2020-04-28 20:23:03 +00:00
|
|
|
runc
|
|
|
|
crun
|
|
|
|
conmon
|
|
|
|
slirp4netns
|
|
|
|
fuse-overlayfs
|
2020-11-24 15:29:28 +00:00
|
|
|
util-linux
|
2020-04-28 20:23:03 +00:00
|
|
|
iptables
|
2021-05-25 15:39:23 +00:00
|
|
|
iproute2
|
2020-04-28 20:23:03 +00:00
|
|
|
] ++ extraPackages);
|
|
|
|
|
2022-02-17 00:56:18 +00:00
|
|
|
helpersBin = symlinkJoin {
|
|
|
|
name = "${podman.pname}-helper-binary-wrapper-${podman.version}";
|
|
|
|
|
|
|
|
# this only works for some binaries, others may need to be be added to `binPath` or in the modules
|
|
|
|
paths = [
|
|
|
|
catatonit # added here for the pause image and also set in `containersConf` for `init_path`
|
|
|
|
podman.rootlessport
|
|
|
|
];
|
|
|
|
};
|
|
|
|
|
2020-04-28 20:23:03 +00:00
|
|
|
in runCommand podman.name {
|
2020-05-04 19:58:31 +00:00
|
|
|
name = "${podman.pname}-wrapper-${podman.version}";
|
2020-05-13 23:39:22 +00:00
|
|
|
inherit (podman) pname version passthru;
|
2020-05-04 19:58:31 +00:00
|
|
|
|
2021-02-13 14:30:13 +00:00
|
|
|
preferLocalBuild = true;
|
|
|
|
|
2020-05-04 19:58:31 +00:00
|
|
|
meta = builtins.removeAttrs podman.meta [ "outputsToInstall" ];
|
|
|
|
|
2020-05-04 23:28:00 +00:00
|
|
|
outputs = [
|
|
|
|
"out"
|
|
|
|
"man"
|
|
|
|
];
|
2020-05-04 19:58:31 +00:00
|
|
|
|
2020-04-28 20:23:03 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
makeWrapper
|
|
|
|
];
|
|
|
|
|
|
|
|
} ''
|
2020-05-04 23:28:00 +00:00
|
|
|
ln -s ${podman.man} $man
|
2020-04-28 20:23:03 +00:00
|
|
|
|
2020-05-01 08:24:09 +00:00
|
|
|
mkdir -p $out/bin
|
2021-05-30 01:14:03 +00:00
|
|
|
ln -s ${podman-unwrapped}/etc $out/etc
|
2021-01-28 15:22:47 +00:00
|
|
|
ln -s ${podman-unwrapped}/lib $out/lib
|
2020-05-01 08:24:09 +00:00
|
|
|
ln -s ${podman-unwrapped}/share $out/share
|
|
|
|
makeWrapper ${podman-unwrapped}/bin/podman $out/bin/podman \
|
2022-02-17 00:56:18 +00:00
|
|
|
--set CONTAINERS_HELPER_BINARY_DIR ${helpersBin}/bin \
|
2020-04-28 20:23:03 +00:00
|
|
|
--prefix PATH : ${binPath}
|
|
|
|
''
|