2020-04-28 21:23:03 +01:00
|
|
|
{ podman-unwrapped
|
|
|
|
, runCommand
|
|
|
|
, makeWrapper
|
|
|
|
, lib
|
|
|
|
, extraPackages ? []
|
|
|
|
, podman # Docker compat
|
|
|
|
, runc # Default container runtime
|
2020-05-11 18:58:45 +01:00
|
|
|
, crun # Container runtime (default with cgroups v2 for podman/buildah)
|
2020-04-28 21:23:03 +01:00
|
|
|
, conmon # Container runtime monitor
|
|
|
|
, slirp4netns # User-mode networking for unprivileged namespaces
|
|
|
|
, fuse-overlayfs # CoW for images, much faster than default vfs
|
|
|
|
, utillinux # nsenter
|
2020-05-11 18:58:45 +01:00
|
|
|
, cni-plugins # not added to path
|
2020-04-28 21:23:03 +01:00
|
|
|
, iptables
|
|
|
|
}:
|
|
|
|
|
|
|
|
let
|
|
|
|
podman = podman-unwrapped;
|
|
|
|
|
|
|
|
binPath = lib.makeBinPath ([
|
|
|
|
runc
|
|
|
|
crun
|
|
|
|
conmon
|
|
|
|
slirp4netns
|
|
|
|
fuse-overlayfs
|
|
|
|
utillinux
|
|
|
|
iptables
|
|
|
|
] ++ extraPackages);
|
|
|
|
|
|
|
|
in runCommand podman.name {
|
2020-05-04 20:58:31 +01:00
|
|
|
name = "${podman.pname}-wrapper-${podman.version}";
|
2020-05-14 00:39:22 +01:00
|
|
|
inherit (podman) pname version passthru;
|
2020-05-04 20:58:31 +01:00
|
|
|
|
|
|
|
meta = builtins.removeAttrs podman.meta [ "outputsToInstall" ];
|
|
|
|
|
2020-05-05 00:28:00 +01:00
|
|
|
outputs = [
|
|
|
|
"out"
|
|
|
|
"man"
|
|
|
|
];
|
2020-05-04 20:58:31 +01:00
|
|
|
|
2020-04-28 21:23:03 +01:00
|
|
|
nativeBuildInputs = [
|
|
|
|
makeWrapper
|
|
|
|
];
|
|
|
|
|
|
|
|
} ''
|
2020-05-05 00:28:00 +01:00
|
|
|
ln -s ${podman.man} $man
|
2020-04-28 21:23:03 +01:00
|
|
|
|
2020-05-01 09:24:09 +01:00
|
|
|
mkdir -p $out/bin
|
|
|
|
ln -s ${podman-unwrapped}/share $out/share
|
|
|
|
makeWrapper ${podman-unwrapped}/bin/podman $out/bin/podman \
|
2020-04-28 21:23:03 +01:00
|
|
|
--prefix PATH : ${binPath}
|
|
|
|
''
|