2
0
mirror of https://github.com/NixOS/nixpkgs.git synced 2024-12-21 13:13:33 +00:00
nixpkgs/pkgs/applications/virtualization/cri-o/wrapper.nix

52 lines
935 B
Nix
Raw Normal View History

2020-05-11 17:58:44 +00:00
{ cri-o-unwrapped
, runCommand
, makeWrapper
, lib
, extraPackages ? []
, cri-o
, runc # Default container runtime
, crun # Container runtime (default with cgroups v2 for podman/buildah)
, conmon # Container runtime monitor
2020-11-24 15:29:28 +00:00
, util-linux # nsenter
2020-05-11 17:58:44 +00:00
, cni-plugins # not added to path
, iptables
}:
let
cri-o = cri-o-unwrapped;
binPath = lib.makeBinPath ([
runc
crun
conmon
2020-11-24 15:29:28 +00:00
util-linux
2020-05-11 17:58:44 +00:00
iptables
] ++ extraPackages);
in runCommand cri-o.name {
name = "${cri-o.pname}-wrapper-${cri-o.version}";
2020-08-23 22:42:49 +00:00
inherit (cri-o) pname version passthru;
2020-05-11 17:58:44 +00:00
meta = builtins.removeAttrs cri-o.meta [ "outputsToInstall" ];
outputs = [
"out"
"man"
];
nativeBuildInputs = [
makeWrapper
];
} ''
ln -s ${cri-o.man} $man
mkdir -p $out/bin
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
''