depot/third_party/nixpkgs/pkgs/applications/virtualization/cri-o/wrapper.nix
Default email 6d4aeb4377 Project import generated by Copybara.
GitOrigin-RevId: 0f213d0fee84280d8c3a97f7469b988d6fe5fcdf
2023-01-11 08:51:40 +01:00

50 lines
993 B
Nix

{ cri-o-unwrapped
, runCommand
, makeWrapper
, lib
, extraPackages ? []
, runc # Default container runtime
, crun # Container runtime (default with cgroups v2 for podman/buildah)
, conmon # Container runtime monitor
, util-linux # nsenter
, iptables
}:
let
binPath = lib.makeBinPath ([
runc
crun
conmon
util-linux
iptables
] ++ extraPackages);
in runCommand cri-o-unwrapped.name {
name = "${cri-o-unwrapped.pname}-wrapper-${cri-o-unwrapped.version}";
inherit (cri-o-unwrapped) pname version passthru;
preferLocalBuild = true;
meta = builtins.removeAttrs cri-o-unwrapped.meta [ "outputsToInstall" ];
outputs = [
"out"
"man"
];
nativeBuildInputs = [
makeWrapper
];
} ''
ln -s ${cri-o-unwrapped.man} $man
mkdir -p $out/bin
ln -s ${cri-o-unwrapped}/etc $out/etc
ln -s ${cri-o-unwrapped}/share $out/share
for p in ${cri-o-unwrapped}/bin/*; do
makeWrapper $p $out/bin/''${p##*/} \
--prefix PATH : ${binPath}
done
''