2020-05-03 17:38:23 +00:00
|
|
|
{ podman-unwrapped
|
|
|
|
, runCommand
|
|
|
|
, makeWrapper
|
2022-03-05 16:20:37 +00:00
|
|
|
, symlinkJoin
|
2020-05-03 17:38:23 +00:00
|
|
|
, lib
|
2022-03-05 16:20:37 +00:00
|
|
|
, stdenv
|
2020-05-03 17:38:23 +00:00
|
|
|
, extraPackages ? []
|
|
|
|
, 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-03 17:38:23 +00:00
|
|
|
, iptables
|
2021-06-01 10:57:12 +00:00
|
|
|
, iproute2
|
2022-03-05 16:20:37 +00:00
|
|
|
, catatonit
|
|
|
|
, gvproxy
|
2023-01-11 07:51:40 +00:00
|
|
|
, aardvark-dns
|
|
|
|
, netavark
|
2020-05-03 17:38:23 +00:00
|
|
|
}:
|
|
|
|
|
2022-03-05 16:20:37 +00:00
|
|
|
# do not add qemu to this wrapper, store paths get written to the podman vm config and break when GCed
|
|
|
|
|
2020-05-03 17:38:23 +00:00
|
|
|
let
|
2021-10-14 00:43:12 +00:00
|
|
|
binPath = lib.makeBinPath ([
|
2022-03-05 16:20:37 +00:00
|
|
|
] ++ 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
|
2020-05-03 17:38:23 +00:00
|
|
|
] ++ extraPackages);
|
|
|
|
|
2022-03-05 16:20:37 +00:00
|
|
|
helpersBin = symlinkJoin {
|
2022-11-21 17:40:18 +00:00
|
|
|
name = "${podman-unwrapped.pname}-helper-binary-wrapper-${podman-unwrapped.version}";
|
2022-03-05 16:20:37 +00:00
|
|
|
|
|
|
|
# this only works for some binaries, others may need to be be added to `binPath` or in the modules
|
|
|
|
paths = [
|
|
|
|
gvproxy
|
|
|
|
] ++ lib.optionals stdenv.isLinux [
|
2023-01-11 07:51:40 +00:00
|
|
|
aardvark-dns
|
2022-03-05 16:20:37 +00:00
|
|
|
catatonit # added here for the pause image and also set in `containersConf` for `init_path`
|
2023-01-11 07:51:40 +00:00
|
|
|
netavark
|
2022-11-21 17:40:18 +00:00
|
|
|
podman-unwrapped.rootlessport
|
2022-03-05 16:20:37 +00:00
|
|
|
];
|
|
|
|
};
|
|
|
|
|
2022-11-21 17:40:18 +00:00
|
|
|
in runCommand podman-unwrapped.name {
|
|
|
|
name = "${podman-unwrapped.pname}-wrapper-${podman-unwrapped.version}";
|
|
|
|
inherit (podman-unwrapped) pname version passthru;
|
2020-05-15 21:57:56 +00:00
|
|
|
|
2021-02-16 17:04:54 +00:00
|
|
|
preferLocalBuild = true;
|
|
|
|
|
2022-11-21 17:40:18 +00:00
|
|
|
meta = builtins.removeAttrs podman-unwrapped.meta [ "outputsToInstall" ];
|
2020-05-15 21:57:56 +00:00
|
|
|
|
|
|
|
outputs = [
|
|
|
|
"out"
|
|
|
|
"man"
|
|
|
|
];
|
|
|
|
|
2020-05-03 17:38:23 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
makeWrapper
|
|
|
|
];
|
|
|
|
|
|
|
|
} ''
|
2022-11-21 17:40:18 +00:00
|
|
|
ln -s ${podman-unwrapped.man} $man
|
2020-05-15 21:57:56 +00:00
|
|
|
|
|
|
|
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 \
|
2022-03-05 16:20:37 +00:00
|
|
|
--set CONTAINERS_HELPER_BINARY_DIR ${helpersBin}/bin \
|
2022-05-18 14:49:53 +00:00
|
|
|
--prefix PATH : ${lib.escapeShellArg binPath}
|
2020-05-03 17:38:23 +00:00
|
|
|
''
|