nixpkgs/pkgs/applications/virtualization/podman/wrapper.nix

67 lines
1.3 KiB
Nix
Raw Normal View History

{ podman-unwrapped
, runCommand
, makeWrapper
, lib
, stdenv
, 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)
, 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
, iptables
, iproute2
2021-08-03 00:58:51 +00:00
, gvproxy
, qemu
, xz
}:
let
podman = podman-unwrapped;
binPath = lib.makeBinPath ([ ] ++ lib.optionals stdenv.isLinux [
runc
crun
conmon
slirp4netns
fuse-overlayfs
2020-11-24 15:29:28 +00:00
util-linux
iptables
iproute2
] ++ lib.optionals stdenv.isDarwin [
2021-08-03 00:58:51 +00:00
gvproxy
qemu
xz
] ++ extraPackages);
in runCommand podman.name {
name = "${podman.pname}-wrapper-${podman.version}";
2020-05-13 23:39:22 +00:00
inherit (podman) pname version passthru;
preferLocalBuild = true;
meta = builtins.removeAttrs podman.meta [ "outputsToInstall" ];
outputs = [
"out"
"man"
];
nativeBuildInputs = [
makeWrapper
];
} ''
ln -s ${podman.man} $man
mkdir -p $out/bin
2021-05-30 01:14:03 +00:00
ln -s ${podman-unwrapped}/etc $out/etc
ln -s ${podman-unwrapped}/lib $out/lib
ln -s ${podman-unwrapped}/share $out/share
makeWrapper ${podman-unwrapped}/bin/podman $out/bin/podman \
--prefix PATH : ${binPath}
''