nixpkgs/pkgs/applications/virtualization/cri-o/wrapper.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

53 lines
1.0 KiB
Nix
Raw Normal View History

2020-05-11 17:58:44 +00:00
{ cri-o-unwrapped
, runCommand
, makeWrapper
, lib
, extraPackages ? []
, runc # Default container runtime
2023-01-27 22:25:56 +00:00
, conntrack-tools
2020-05-11 17:58:44 +00:00
, 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
, iptables
}:
let
binPath = lib.makeBinPath ([
runc
2023-01-27 22:25:56 +00:00
conntrack-tools
2020-05-11 17:58:44 +00:00
crun
conmon
2020-11-24 15:29:28 +00:00
util-linux
2020-05-11 17:58:44 +00:00
iptables
] ++ extraPackages);
2022-11-16 02:37:22 +00:00
in runCommand cri-o-unwrapped.name {
name = "${cri-o-unwrapped.pname}-wrapper-${cri-o-unwrapped.version}";
inherit (cri-o-unwrapped) pname version passthru;
2020-05-11 17:58:44 +00:00
preferLocalBuild = true;
2022-11-16 02:37:22 +00:00
meta = builtins.removeAttrs cri-o-unwrapped.meta [ "outputsToInstall" ];
2020-05-11 17:58:44 +00:00
outputs = [
"out"
"man"
];
nativeBuildInputs = [
makeWrapper
];
} ''
2022-11-16 02:37:22 +00:00
ln -s ${cri-o-unwrapped.man} $man
2020-05-11 17:58:44 +00:00
mkdir -p $out/bin
2023-01-01 02:14:11 +00:00
ln -s ${cri-o-unwrapped}/etc $out/etc
2020-05-11 17:58:44 +00:00
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
''