2020-04-28 21:23:03 +01:00
|
|
|
{ podman-unwrapped
|
|
|
|
, runCommand
|
|
|
|
, makeWrapper
|
|
|
|
, lib
|
|
|
|
, extraPackages ? []
|
|
|
|
, podman # Docker compat
|
|
|
|
, runc # Default container runtime
|
|
|
|
, crun # Default container runtime (cgroups v2)
|
|
|
|
, 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
|
|
|
|
, iptables
|
|
|
|
}:
|
|
|
|
|
|
|
|
let
|
|
|
|
podman = podman-unwrapped;
|
|
|
|
|
|
|
|
binPath = lib.makeBinPath ([
|
|
|
|
runc
|
|
|
|
crun
|
|
|
|
conmon
|
|
|
|
slirp4netns
|
|
|
|
fuse-overlayfs
|
|
|
|
utillinux
|
|
|
|
iptables
|
|
|
|
] ++ extraPackages);
|
|
|
|
|
2020-05-04 20:58:31 +01:00
|
|
|
outputs = [
|
|
|
|
"out"
|
|
|
|
"man"
|
|
|
|
];
|
|
|
|
|
2020-04-28 21:23:03 +01:00
|
|
|
in runCommand podman.name {
|
2020-05-04 20:58:31 +01:00
|
|
|
name = "${podman.pname}-wrapper-${podman.version}";
|
|
|
|
inherit (podman) pname version;
|
|
|
|
|
|
|
|
meta = builtins.removeAttrs podman.meta [ "outputsToInstall" ];
|
|
|
|
|
|
|
|
inherit outputs;
|
|
|
|
|
2020-04-28 21:23:03 +01:00
|
|
|
nativeBuildInputs = [
|
|
|
|
makeWrapper
|
|
|
|
];
|
|
|
|
|
|
|
|
} ''
|
2020-05-01 09:24:09 +01:00
|
|
|
# Symlink everything but $out from podman-unwrapped
|
2020-04-28 21:23:03 +01:00
|
|
|
${
|
|
|
|
lib.concatMapStringsSep "\n"
|
|
|
|
(o: "ln -s ${podman.${o}} ${placeholder o}")
|
2020-05-01 09:24:09 +01:00
|
|
|
(builtins.filter (o: o != "out")
|
2020-05-04 20:58:31 +01:00
|
|
|
outputs)}
|
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}
|
|
|
|
''
|