2020-05-03 17:38:23 +00:00
|
|
|
{ podman-unwrapped
|
|
|
|
, runCommand
|
|
|
|
, makeWrapper
|
|
|
|
, lib
|
2021-07-17 21:14:59 +00:00
|
|
|
, stdenv
|
2020-05-03 17:38:23 +00:00
|
|
|
, extraPackages ? []
|
|
|
|
, podman # Docker compat
|
|
|
|
, runc # Default container runtime
|
2020-05-29 06:06:01 +00:00
|
|
|
, crun # Container runtime (default with cgroups v2 for podman/buildah)
|
2020-05-03 17:38:23 +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 20:58:05 +00:00
|
|
|
, util-linux # nsenter
|
2020-05-29 06:06:01 +00:00
|
|
|
, cni-plugins # not added to path
|
2020-05-03 17:38:23 +00:00
|
|
|
, iptables
|
2021-06-01 10:57:12 +00:00
|
|
|
, iproute2
|
2021-07-17 21:14:59 +00:00
|
|
|
, qemu
|
|
|
|
, xz
|
2020-05-03 17:38:23 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
let
|
|
|
|
podman = podman-unwrapped;
|
|
|
|
|
2021-07-17 21:14:59 +00:00
|
|
|
binPath = lib.makeBinPath ([ ] ++ lib.optionals stdenv.isLinux [
|
2020-05-03 17:38:23 +00:00
|
|
|
runc
|
|
|
|
crun
|
|
|
|
conmon
|
|
|
|
slirp4netns
|
|
|
|
fuse-overlayfs
|
2020-11-24 20:58:05 +00:00
|
|
|
util-linux
|
2020-05-03 17:38:23 +00:00
|
|
|
iptables
|
2021-06-01 10:57:12 +00:00
|
|
|
iproute2
|
2021-07-17 21:14:59 +00:00
|
|
|
] ++ lib.optionals stdenv.isDarwin [
|
|
|
|
qemu
|
|
|
|
xz
|
2020-05-03 17:38:23 +00:00
|
|
|
] ++ extraPackages);
|
|
|
|
|
|
|
|
in runCommand podman.name {
|
2020-05-15 21:57:56 +00:00
|
|
|
name = "${podman.pname}-wrapper-${podman.version}";
|
|
|
|
inherit (podman) pname version passthru;
|
|
|
|
|
2021-02-16 17:04:54 +00:00
|
|
|
preferLocalBuild = true;
|
|
|
|
|
2020-05-15 21:57:56 +00:00
|
|
|
meta = builtins.removeAttrs podman.meta [ "outputsToInstall" ];
|
|
|
|
|
|
|
|
outputs = [
|
|
|
|
"out"
|
|
|
|
"man"
|
|
|
|
];
|
|
|
|
|
2020-05-03 17:38:23 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
makeWrapper
|
|
|
|
];
|
|
|
|
|
|
|
|
} ''
|
2020-05-15 21:57:56 +00:00
|
|
|
ln -s ${podman.man} $man
|
|
|
|
|
|
|
|
mkdir -p $out/bin
|
2021-06-01 10:57:12 +00:00
|
|
|
ln -s ${podman-unwrapped}/etc $out/etc
|
2021-02-16 17:04:54 +00:00
|
|
|
ln -s ${podman-unwrapped}/lib $out/lib
|
2020-05-15 21:57:56 +00:00
|
|
|
ln -s ${podman-unwrapped}/share $out/share
|
|
|
|
makeWrapper ${podman-unwrapped}/bin/podman $out/bin/podman \
|
2020-05-03 17:38:23 +00:00
|
|
|
--prefix PATH : ${binPath}
|
|
|
|
''
|